Feb 22, 2013, 2:07 AM
Why through the view web page code can see all data ?
HI,When I run this code,then Right-Click on the page and select "See page source code",it can see all the data?why?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="WebApplication18.WebForm3" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Store store = this.SelectBox1.GetStore();
store.DataSource = new object[]
{
new object[] { "AL", "Alabama", "The Heart of Dixie" },
new object[] { "AK", "Alaska", "The Land of the Midnight Sun" },
new object[] { "AZ", "Arizona", "The Grand Canyon State" }
};
store.DataBind();
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>SelectBox - Ext.NET Examples</title>
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
</head>
<body>
<form id="Form1" runat="server">
<h3>SelectBox</h3>
<p>A Component similar to an HTML SELECT input. Supports clicking and dragging
through the list, with item selection occurring when the mouse button is released.</p>
<ext:SelectBox
ID="SelectBox1"
runat="server"
DisplayField="state"
ValueField="abbr"
EmptyText="Select a state...">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="abbr" />
<ext:ModelField Name="state" />
<ext:ModelField Name="nick" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:SelectBox>
</form>
</body>
</html>
Right-Click on the page and select "See page source code",It shows the following code //<![CDATA[
Ext.net.ResourceMgr.init({id:"ResourceManager1",aspForm:"Form1"});Ext.onReady(function(){Ext.create("Ext.ux.SelectBox",{id:"SelectBox1",renderTo:"App.SelectBox1_Container",emptyText:"Select a state...",displayField:"state",triggerAction:"all",valueField:"abbr",store:{model:Ext.define(Ext.id(), {extend: "Ext.data.Model", fields:[{name:"abbr"},{name:"state"},{name:"nick"}] }),storeId:"ctl01",autoLoad:true,proxy:{data:[["AL","Alabama","The Heart of Dixie"],["AK","Alaska","The Land of the Midnight Sun"],["AZ","Arizona","The Grand Canyon State"]], type: 'memory', reader:{type:"array"}}}});});
//]]>
Last edited by richard; Feb 22, 2013 at 2:22 AM.