kisslogicgoodbye
Programmer
Why is my code and the "view Source" Browser code different? Where did that javascript stuff come from?
Here is my code:
Language="vb" AutoEventWireup="false" Codebehind="restaurants.aspx.vb" Inherits="restaurants.restaurants1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Restaurants</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body bgColor="#bbbbee" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:datagrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 21px; POSITION: absolute; TOP: 24px" runat="server" AutoGenerateColumns="False" DataSource="<%# dsRestaurants1 %>" DataMember="Restaurant" DataKeyField="Restaurant_ID" Height="596px" Width="817px" OnSortCommand="DataGrid1_SortCommand" AllowSorting="True" BackColor="#CCCCCC" BorderColor="#999999" ForeColor="Black">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#000099"></SelectedItemStyle>
<ItemStyle BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BorderStyle="Outset" BackColor="Black"></HeaderStyle>
<FooterStyle BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
<asp:BoundColumn DataField="Name" SortExpression="Name" HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Type" SortExpression="Type" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn SortExpression="PriceRageLow" HeaderText="Price Range Low">
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRageLow", "{0:C}" %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Width="149px" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRageLow", "{0:C}" %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="PriceRangeHigh" HeaderText="Price Range High">
<ItemTemplate>
<asp:Label id=Label2 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRangeHigh", "{0:C}" %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox2 runat="server" Width="156px" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRangeHigh", "{0:C}" %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Left" ForeColor="Black" BackColor="#CCCCCC" Mode="NumericPages"></PagerStyle>
</asp:datagrid></form>
</body>
</HTML>
When I run my little program and view source this is what I get:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Restaurants</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body bgColor="#bbbbee" MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="restaurants.aspx" id="Form1">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" value="aaa to zzz" />
<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform = document.Form1;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<table cellspacing="0" rules="all" bordercolor="#999999" border="1" id="DataGrid1" style="color:Black;background-color:#CCCCCC;border-color:#999999;height:596px;width:817px;border-collapse:collapse;Z-INDEX: 101; LEFT: 21px; POSITION: absolute; TOP: 24px">
<tr style="color:White;background-color:Black;border-style:Outset;font-weight:bold;">
<td> </td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl0','')" style="color:White;">Name</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl1','')" style="color:White;">Type</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl2','')" style="color:White;">Price Range Low</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl3','')" style="color:White;">Price Range High</a></td>
</tr><tr style="background-color:White;">
<td><input type="submit" name="DataGrid1:_ctl2:_ctl0" value="Edit" /></td><td>American Grill at Galleria</td><td>Italian</td><td>
<span id="DataGrid1__ctl2_Label1">$7.00</span>
</td><td>
etc.
Here is my code:
Language="vb" AutoEventWireup="false" Codebehind="restaurants.aspx.vb" Inherits="restaurants.restaurants1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Restaurants</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body bgColor="#bbbbee" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:datagrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 21px; POSITION: absolute; TOP: 24px" runat="server" AutoGenerateColumns="False" DataSource="<%# dsRestaurants1 %>" DataMember="Restaurant" DataKeyField="Restaurant_ID" Height="596px" Width="817px" OnSortCommand="DataGrid1_SortCommand" AllowSorting="True" BackColor="#CCCCCC" BorderColor="#999999" ForeColor="Black">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#000099"></SelectedItemStyle>
<ItemStyle BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BorderStyle="Outset" BackColor="Black"></HeaderStyle>
<FooterStyle BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
<asp:BoundColumn DataField="Name" SortExpression="Name" HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Type" SortExpression="Type" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn SortExpression="PriceRageLow" HeaderText="Price Range Low">
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRageLow", "{0:C}" %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Width="149px" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRageLow", "{0:C}" %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="PriceRangeHigh" HeaderText="Price Range High">
<ItemTemplate>
<asp:Label id=Label2 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRangeHigh", "{0:C}" %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox2 runat="server" Width="156px" Text='<%# DataBinder.Eval(Container, "DataItem.PriceRangeHigh", "{0:C}" %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Left" ForeColor="Black" BackColor="#CCCCCC" Mode="NumericPages"></PagerStyle>
</asp:datagrid></form>
</body>
</HTML>
When I run my little program and view source this is what I get:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Restaurants</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body bgColor="#bbbbee" MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="restaurants.aspx" id="Form1">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" value="aaa to zzz" />
<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform = document.Form1;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<table cellspacing="0" rules="all" bordercolor="#999999" border="1" id="DataGrid1" style="color:Black;background-color:#CCCCCC;border-color:#999999;height:596px;width:817px;border-collapse:collapse;Z-INDEX: 101; LEFT: 21px; POSITION: absolute; TOP: 24px">
<tr style="color:White;background-color:Black;border-style:Outset;font-weight:bold;">
<td> </td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl0','')" style="color:White;">Name</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl1','')" style="color:White;">Type</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl2','')" style="color:White;">Price Range Low</a></td><td><a href="javascript:__doPostBack('DataGrid1:_ctl1:_ctl3','')" style="color:White;">Price Range High</a></td>
</tr><tr style="background-color:White;">
<td><input type="submit" name="DataGrid1:_ctl2:_ctl0" value="Edit" /></td><td>American Grill at Galleria</td><td>Italian</td><td>
<span id="DataGrid1__ctl2_Label1">$7.00</span>
</td><td>
etc.