CSS won't appear on one asp.net page, fine on others - asp.net

I'm working on a project at the moment that I've recently taken over, which has the Umbraco CMS installed (4.7.1) and is written in ASP.net and I'm not really sure what I'm doing and have got stuck.
The CSS won't appear on one page, the ContactUs page (contact-us.aspx), but the CSS appears perfectly fine everywhere else, which I find really odd.
So my question is what do I need to do to get the CSS appearing on this page, like the others?
Here is the contact-us template:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="ContactUs.master.cs" Inherits="GreenHill.masterpages.ContactUs"
MasterPageFile="~/umbraco/masterpages/default.master"%>
<%# Register TagPrefix="gh" TagName="ProductNav" Src="~/usercontrols/ProductNav.ascx" %>
<%# Register TagPrefix="gh" TagName="ProductListing" Src="~/usercontrols/ProductListing.ascx" %>
<%# Register TagPrefix="gh" TagName="Twitter" Src="~/usercontrols/Twitter.ascx" %>
<asp:Content runat="server" ID="pageContent" ContentPlaceHolderID="content">
<div class="title">
<h1>
<asp:Literal ID="litTitle" runat="server"></asp:Literal></h1>
</div>
<div class="brown-border"></div>
<table class="content">
<tr>
<td class="left main-column">
<asp:Image runat="server" ID="imgHero" />
</td>
<td class="side-panel" rowspan="2">
<gh:Twitter runat="server" id="ucTwitter"></gh:Twitter><br />
</td>
</tr>
<tr>
<td>
<table class="small-table">
<tr>
<td class="left">
<h2>Contact Us</h2>
</td>
<td>
<h2>Say hi to the team</h2>
</td>
</tr>
<tr>
<td colspan="2">
<div class="brown-border small-table-separator"></div>
</td>
</tr>
<tr>
<td>
<asp:Literal runat="server" ID="litContent"></asp:Literal>
</td>
<td>
<form ID="form1" runat="server">
<div class="form">
<ul>
<li>
<asp:TextBox ID="txtName" runat="server" placeholder="Name"></asp:TextBox>
</li>
<li>
<span id="nameError" class="error-message" style="display:none;">Please enter your name.</span>
</li>
<li>
<asp:TextBox ID="txtEmail" runat="server" placeholder="Email"></asp:TextBox>
</li>
<li>
<span id="emailError" class="error-message" style="display:none;">Please enter your email address.</span>
</li>
<li>
<asp:TextBox ID="txtMessage" runat="server" Rows="5" TextMode="MultiLine" placeholder="Message"></asp:TextBox>
</li>
<li>
<span id="messageError" class="error-message" style="display:none;">Please enter the message.</span>
</li>
<li>
<asp:Literal ID="litMessage" runat="server"></asp:Literal>
</li>
<li>
<asp:Button CssClass="button" ID="btnSend" runat="server" Text="Send" OnClientClick="return validate()" />
</li>
</ul>
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script>
$(document).ready(function () {
RelatedProducts.addGap();
});
</script>
</asp:Content>
And here is the base template:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Base.master.cs" Inherits="GreenHill.masterpages.Base" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Greenhill Timbers</title>
<asp:contentPlaceholder id="head" runat="server" />
<link rel="stylesheet" type="text/css" href="/css/global.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/scripts/navigation.js" type="text/javascript"></script>
<script src="/scripts/tinker.js" type="text/javascript"></script>
<script type="text/javascript" src="/scripts/jcarousellite_1.0.1.pack.js"></script>
<script type="text/javascript" src="/scripts/captify.tiny.js"></script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f07fd7a7ce8f226"></script>
<script type="text/javascript">
//jCarouselLite
$(function () {
$(".slider").jCarouselLite({
//btnNext: ".next",
auto: 3000,
visible: 1,
speead: 1000
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="top-nav">
<!--Contact Us | Sitemap | Example-->
</div>
<div class="brown-border"></div>
<div class="header">
<img class="logo" src="/images/GH_Top_Logo.png" />
<asp:Repeater ID="rptNav" runat="server" OnItemDataBound="rptNav_DataBound">
<HeaderTemplate>
<ul class="main-nav">
<li>Home</li>
</HeaderTemplate>
<ItemTemplate>
<li class="separator">|</li>
<li>
<asp:HyperLink ID="linkPage" runat="server">
<asp:Literal ID="litPageTitle" runat="server"></asp:Literal>
</asp:HyperLink>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</div>
<div class="brown-border"></div>
<div class="main-outer">
<div class="main">
<asp:ContentPlaceHolder ID="content" runat="server">
</asp:ContentPlaceHolder>
<div class="footer-logo">
<img src="/images/GH_Stamp_Footer.png" />
</div>
</div>
<p class="footer">© 2011 GREENHILL TIMBERS P/L | 170 Settlement Road, Thomastown 3074 Australia | P. 03 9465 9875 | <a class="footer-link" href="mailto:info#greenhilltimbers.com.au">info#greenhilltimbers.com.au</a></p>
</div>
</form>
</body>
</html>
And finally there default.master template:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="default.master.cs" Inherits="umbraco.presentation.masterpages._default" %>
<asp:ContentPlaceHolder ID="ContentPlaceHolderDefault" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="content" runat="server">
</asp:ContentPlaceHolder>

You have:
MasterPageFile="~/umbraco/masterpages/default.master"
Which means your Contact Us page is inheriting from the default Umbraco master page, and not your base master page.
I just realized in typing this that your question is a week old, but I'm going to answer anyway. :)

Related

On postback css setting deleted from masterpage

I saw several post similar to mine but couldn't find a solution that fits my issue (the masterpage issue :) ).
I have a masterpage with side menu , that I created with a list (ul > li).
Whenever I select a li which refers to nowhere("ftq" for example) - the function works great and changes the css setting as I want.
But, whenever I select a li which refer to a "real" page ("updateinspec.aspx" for example) and there's a postback, all the CSS is gone .
here's the code - any help will be great
<%# Master Language="VB" AutoEventWireup="false" CodeBehind="MasterVC.master.vb" Inherits="HangarApp.MasterVC" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="MasterCSS.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
function myFunction(x) {
x.classList.toggle("change");
}
var lst;
function cngclass(obj) {
if (lst) lst.className = '';
obj.className = 'listactive';
lst = obj;
}
</script>
<asp:ContentPlaceHolder ID="headtitlePH" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div id="topcontent">
<div class="menudiv" onclick="myFunction(this)">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<div class="divtitle">
<img src="../images/logo1.png" />
<asp:Label runat="server" ID="userlbl" style="padding:12%;"></asp:Label>
</div>
</div>
<div id="subtopdiv">
<div id="sub_inspec">
<br />
<asp:Label ID="stationname" runat="server" CssClass="subtopdiv"></asp:Label>
<asp:Label ID="stationcode" runat="server" Visible="false" ></asp:Label>
<asp:Label ID="linecode" runat="server" Visible="false"></asp:Label>
<asp:Label ID="typecode" runat="server" Visible="false"></asp:Label>
<asp:Label ID="lblinspecnum" runat="server" Visible="false"></asp:Label>
</div>
</div>
<div id="maincontent">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<h1></h1>
<div class="innerdiv" id="divlefttop">
<asp:ContentPlaceHolder ID="divlefttopPH" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="innerdivdtop" id="divrighttop" runat="server">
<asp:ContentPlaceHolder ID="divrighttopPH" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="innerdivld" id="divleftdown" runat="server">
<asp:ContentPlaceHolder ID="divleftdownPH" runat="server" >
</asp:ContentPlaceHolder>
</div>
<div class="innerdivd" id="divrightdown">
<asp:ContentPlaceHolder ID="divrightdownPH" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<div id="leftcontent">
<div id="menuinsp" runat="server">
<ul>
<li><a onclick="cngclass(this);" class="active" href="Inspec_Main.aspx">Inspection APP</a></li>
<li><a onclick="cngclass(this);" class="nactive" href="#ftqpage">FTQ</a></li>
<li><a onclick="cngclass(this);" class="nactive" href="#managepage">MANAGE</a></li>
<li><a onclick="cngclass(this);" class="nactive" href="UpdateInspec.aspx">UPDATE</a></li>
<li><a onclick="cngclass(this);" class="nactive" href="#about">ABOUT</a></li>
</ul>
</div>
</div>
<div id="footercontent">
<label>LAHAV IT SYSTEM - DANA B COHEN - TEL:58840</label>
</div>
<asp:ContentPlaceHolder ID="footertitlePH" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
I think your master page isn't in the same directory as the aspx pages and you didn't use correct href in below link:
<link href="MasterCSS.css" type="text/css" rel="stylesheet" />
You need use server side link like this.
Modify your Mastercss.css link as given below and let us know if problem still exist.
<link href="/MasterCSS.css" type="text/css" rel="stylesheet" />

How can I avoid a nested form situation?

Ok basically I have a master page which has all the design in a Form with runat server as follows:
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<table style="font-family: Arial">
<tr>
<td colspan="2" style="width: 800px; height: 80px; background-color: #3399FF; text-align: center">
<h1>WebSite Header
</h1>
</td>
</tr>
<tr>
<td style="height: 500px; background-color: #66FFFF; width: 150px">
<h3>Menu</h3>
</td>
<td style="height: 500px; background-color: #9999FF; width: 650px">
<h3>content</h3>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
<p>
</p>
</asp:ContentPlaceHolder>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="background-color: #3399FF; text-align: center">
<b>Website Footer</b>
</td>
</tr>
</table>
</form>
</body>
</html>
Now I am trying to do a page using this master page and in this page I am initializing a CKEditor which apparently needs to be in a form with runat server to be able to function, as follows:
<%# Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="CkEditor.aspx.cs" Inherits="WebApplication5.CkEditor" %>
<%# Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<form id="form2" runat="server">
<div>
<div>
<CKEditor:CKEditorControl ID="CKEditor1" runat="server">
</CKEditor:CKEditorControl>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<asp:Label ID="lblText" runat="server" Text=" "></asp:Label>
</div>
</form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
The Form however with the CKEditor in it is not allowing to be initialized because it is becoming a Nested Form, since the master page itself is bound in a form.
How can I prevent this please?
Your CKEditorControl will inherit the form from the master page.
First, move your asp:ContentPlaceHolder from the head tag:
<head runat="server">
<title></title>
<!--DON'T PUT IT HERE-->
</head>
<body>
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
...
Now you can remove the form2:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!--<form id="form2" runat="server">-->
<div>
<div>
<CKEditor:CKEditorControl ID="CKEditor1" runat="server">
</CKEditor:CKEditorControl>
...

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />

i have page and add Ajax extension but it throwing error for me
i am using master page so this page doesn't have <head>
page code
<%# Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" runat="server" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 100%">
<tr>
<td colspan="5" style="text-align: center; height: 20px;">Search </td>
</tr>
<tr>
<td style="text-align: center; height: 20px;">Ticket number</td>
<td style="text-align: center; height: 20px;">Client name</td>
<td style="text-align: center; height: 20px;">Address</td>
<td style="text-align: center; height: 20px;">Assigned to</td>
<td style="text-align: center; height: 20px;">Date</td>
</tr>
<tr>
<td style="width: 157px">
<asp:TextBox ID="txt_incID" runat="server" Width="146px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txb_ClientName" runat="server" Width="146px"></asp:TextBox>
</td>
<td>
<asp:DropDownList ID="ddl_Address" runat="server" Width="146px" DataSourceID="Ds_address" DataTextField="StrName" DataValueField="StrID">
<asp:ListItem Value="null"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="ddl_EmpID" runat="server" Width="146px" DataSourceID="DS_Employee" DataTextField="LastName" DataValueField="EmpID">
<asp:ListItem Value="null"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="txb_date" runat="server" Width="146px"></asp:TextBox>
<asp:CalendarExtender ID="txb_date_CalendarExtender" runat="server" Enabled="True" TargetControlID="txb_date">
</asp:CalendarExtender>
</td>
</tr>
<tr>
<td style="width: 157px"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="width: 157px"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br />
<br />
<asp:SqlDataSource ID="Ds_address" runat="server" ConnectionString="<%$ ConnectionStrings:TicketsConnectionString %>" SelectCommand="SELECT * FROM [Streets]"></asp:SqlDataSource>
<asp:SqlDataSource ID="DS_Employee" runat="server" ConnectionString="<%$ ConnectionStrings:TicketsConnectionString %>" SelectCommand="SELECT * FROM [Employee]"></asp:SqlDataSource>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</asp:Content>
in other topics people recommend add this
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
but I have it on my page. Any ideas how to fix?
Master page code
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Tickets</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Archivo+Narrow:400,700" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
.Buttons
{
font-family: Tahoma;
font-size: large;
background-color: #999999;
border-bottom-color: #FF0000;
border-style: none none outset none;
}
.Logins
{
font-family: tahoma;
color: #FF0000;
}
.ButtonsInSite
{
font-family: tahoma;
background-color: #C0C0C0;
border-color: #FFFFFF #FFFFFF #FF0000 #FFFFFF;
border-bottom-style: double;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
box-shadow: 0px 2px 9px #800000;
font-weight: bold;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="header-wrapper">
<div id="header">
<div id="logo">
<h1>Tickets</h1>
<div style="text-align: right">
<asp:LoginName ID="LoginName2" runat="server" CssClass="Logins" />
|
<asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="Logins" />
</div>
</div>
</div>
</div>
<div id="wrapper">
<!-- end #header -->
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="sidebar">
<h2>Navigation</h2>
<asp:Button ID="Button1" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite" />
<br />
<asp:Button ID="Button2" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/>
<br />
<asp:Button ID="Button3" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/>
<br />
<asp:Button ID="Button4" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/>
<br />
<asp:Button ID="Button5" runat="server" Text="Admin" Width="118px" CssClass="ButtonsInSite" PostBackUrl="~/Admin/AdmStart.aspx"/>
<br />
</div>
<!-- end #sidebar -->
<div id="content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- end #content -->
<div style="clear: both;"> </div>
</div>
</div>
</div>
<!-- end #page -->
</div>
<div id="footer">
<p> © 2013</p>
</div>
<!-- end #footer -->
</form>
</body>
</html>
May be this will help you.
Master page Html
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
Child Page Html
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">Add Scripts here</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
Add Page Content Here</asp:Content>
Add in the master page
<head runat="server">
In a child page header ContentPlaceHolderID just add <head runat="server"></head>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2Header" runat="Server">
<head runat="server">
</head>
<script src="http://code.jquery.com/jquery-latest.min.js"
type="text/javascript"></script>
</asp:Content>
Can you add <head runat="server"> to the master page??
In Master Page add
<head id="Head1" runat="server">
//Other script
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
In child page add
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
//add script for child page
<script>
</script>
</asp:Content>
Try this
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
in the MASTER PAGE code!
Just substitute <head> for <head id="head1" runat="server">

CSS : Sharepoint asp.net menu UI bugging out

I find that the Sharepoint asp.net dropdown menus aren't following the styles that they should in every browser except IE7.
In the image above you see that the button text is displayed below the button icon instead of next to it; The odd thing is, the same menu viewed from a different page will display correctly.
I've looked through the master page code and can't figure out what would cause this, any pointers would be welcome.
The entire masterpage code is below here if anyone is willing to read all of that :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%#Master language="C#"%>
<%# Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%# Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%# Import Namespace="Microsoft.SharePoint" %>
<%# Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%# Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%# Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%# Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%# Register TagPrefix="SPIntranet" TagName="Ticker" Src="~/_controltemplates/SPIntranetTicker.ascx" %>
<%# Register TagPrefix="SPIntranet" TagName="Banner" Src="~/_controltemplates/SPIntranetBanner.ascx" %>
<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
<HEAD runat="server">
<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<!-- SPECIFY STYLE SHEET -->
<link rel="stylesheet" type="text/css" href="/Style Library/Custom CSS/OlympicIntranet.css" />
<!-- <style>
#mp1_0_8_Anchor{
display:inline-block;
}
#zz10_ID_PersonalizePage{
margin-left:60px;
}
</style>-->
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">
</asp:ContentPlaceHolder>
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
<form class="body" runat="server" onsubmit="return _spFormOnSubmitWrapper();"><asp:ScriptManager ID="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
<WebPartPages:SPWebPartManager id="m" runat="Server"/>
<table class="divMainContainer" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<!-- Site Logo -->
<td>
<table width="100%"cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="divOlympicLogo">
<a href="\">
<span>
<SharePoint:SiteLogoImage id="onetidHeadbnnr0" LogoImageUrl="/_layouts/images/titlegraphic.gif" runat="server"/>
</span>
</a>
</td>
<!-- Quick Link Spacer -->
<td class="divOlympicTopQuickLinkCorner">
<span></span>
</td>
<!-- Quick Links -->
<td class="divQuickLink">
<a id="aBrainDump" href="https://www.braindump.co.nz/olympic" class="icon"><span>
<img src="/images/brain_dump_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aCRM" href="http://crm/" class="icon"><span>
<img src="/images/crm_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aexp" href="http://intranet/expenseclaim/" class="icon"><span>
<img src="/images/expense_claim_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aGoAdmin" href="http://goadmin/" class="icon"><span>
<img src="/images/go_admin_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aLeave" href="http://intranet/Default.aspx?tabid=668" class="icon"><span>
<img src="/images/leave_request_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aReport" href="http://intranet/Default.aspx?tabid=588" class="icon"><span>
<img src="/images/report_centre_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aTimeSheet" href="http://intranet/goweb/ielogin.htm" class="icon"><span>
<img src="/images/time_sheet_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="aTFS" href="http://tfs" class="icon"><span>
<img src="/images/tfs_icon.png" class="imgIcon"></img>
</span></a>
</td >
<td class="divQuickLink">
<a id="awiki" href="http://wikione/Wiki%20Pages/Home.aspx" class="icon"><span>
<img src="/images/wikione_icon.png" class="imgIcon"></img>
</span></a>
</td >
</tr>
</table>
</td>
</tr>
<tr>
<asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
<wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server"/>
</asp:ContentPlaceHolder>
<!-- Publishing console control -->
<asp:ContentPlaceHolder ID="SPNavigation" runat="server">
<td>
<SharePoint:DelegateControl runat="server" ControlId="PublishingConsole"
PrefixHtml="<tr><td colspan="4" id="mpdmconsole" class="ms-consolemptablerow">"
SuffixHtml="</td></tr>"></SharePoint:DelegateControl>
</td>
</asp:ContentPlaceHolder>
</tr>
<tr>
<td style="padding-bottom:5px;">
<!-- Tabs Menu -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="divOlympicTabLeft" align="left">
<SharePoint:AspMenu
ID="TopNavigationMenu"
Runat="server"
DataSourceID="topSiteMap"
EnableViewState="false"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
DynamicHorizontalOffset="0"
StaticPopoutImageUrl="/_layouts/images/menudark.gif"
StaticPopoutImageTextFormatString=""
DynamicHoverStyle-BackColor="#CBE3F0"
SkipLinkText=""
StaticSubMenuIndent="0"
CssClass="ms-topNavContainer"><StaticMenuStyle/><StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/><StaticSelectedStyle CssClass="ms-topnavselected" /><StaticHoverStyle CssClass="ms-topNavHover" /><DynamicMenuStyle BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/><DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/><DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/><DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/></SharePoint:AspMenu>
<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource"><Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
</Template_Controls></SharePoint:DelegateControl>
</td>
<td>
</td>
<td class="IntranetSiteAction" align="right">
<SharePoint:SiteActions runat="server" id="SiteActionsMenuMain"
PrefixHtml="<div><div>"
SuffixHtml="</div></div>"
MenuNotVisibleHtml="&nbsp;"><CustomTemplate>
<SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true">
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="<%$Resources:wss,viewlsts_pagetitle_create%>" Description="<%$Resources:wss,siteactions_createdescription%>" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="100" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/create.aspx" PermissionsString="ManageLists, ManageSubwebs" PermissionMode="Any" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage" Text="<%$Resources:wss,siteactions_editpage%>" Description="<%$Resources:wss,siteactions_editpagedescription%>" ImageUrl="/_layouts/images/ActionsEditPage.gif" MenuGroupId="100" Sequence="200" ClientOnClickNavigateUrl="javascript:MSOLayout_ChangeLayoutMode(false);" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings" Text="<%$Resources:wss,settings_pagetitle%>" Description="<%$Resources:wss,siteactions_sitesettingsdescription%>" ImageUrl="/_layouts/images/ActionsSettings.gif" MenuGroupId="100" Sequence="300" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/settings.aspx" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData" PermissionMode="Any" />
</SharePoint:FeatureMenuTemplate>
</CustomTemplate></SharePoint:SiteActions>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" width="100%" class="style1">
<SPIntranet:Banner id="Banner" runat="server"></SPIntranet:Banner >
</td>
</tr>
<tr>
<td class="tickerBackground">
<table width="100%" style="padding-left:10px; vertical-align:top;" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<img src="/images/whats_today_hdr.png" style="background-color:transparent; vertical-align:bottom;"></img>
</td>
<td style="max-width:300px;padding-left:0px;" valign="middle">
<script src="http://sp2010dev:90/Style Library/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://sp2010dev:90/Style Library/jquery/jquery.marquee.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('marquee').marquee();
});
</script>
<marquee style="width:310px;margin-left:0px;" scrollamount="1">test</marquee>
<!--<SPIntranet:Ticker id="Ticker" runat="server"></SPIntranet:Ticker>-->
</td>
<td class="tickerSearchDivider" style="width:25px;">
<span></span>
</td>
<td class="powerSearchHeading" style="background-color:transparent;">
<img src="/images/power_search_hdr.png" style="background-color:transparent;"></img>
</td>
<td class="searchBackGround" align="right" padding-left="5px">
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr style="background-color:#FFFFFF">
<td>
<table width="100%;" height="10px;">
<tr>
<td>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
<asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
</asp:ContentPlaceHolder>
</td>
<td>
<!--- --- --- Top Toolbar --- --- --->
<!-- Global nav, including breadcrumbs and global links -->
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server">
<span id="TurnOnAccessibility" style="display:none">
<a href="#" class="ms-skip" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return false;">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnonaccessibility%>" EncodeMethod="HtmlEncode"/></a>
</span>
<A href="javascript:;" onclick="javascript:this.href='#mainContent';" class="ms-skip" AccessKey="<%$Resources:wss,maincontent_accesskey%>" runat="server">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></A>
<span id="TurnOffAccessibility" style="display:none">
<a href="#" class="ms-acclink" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();return false;">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>" EncodeMethod="HtmlEncode"/></a>
</span>
<!-- Global Breadcrumb -->
</asp:ContentPlaceHolder>
</td>
<td align="right" >
<!-- Welcome Message-->
<table cellpadding="0" cellspacing="0" height=100% class="ms-globalright" style="background-color:#FFFFFF">
<tr>
<td valign="middle" class="ms-globallinks" style="padding-left:3px; padding-right:6px;">
<SharePoint:DelegateControl runat="server" ControlId="GlobalSiteLink0"/>
</td>
<td valign="middle" class="ms-globallinks">
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
</td>
<td style="padding-left:1px;padding-right:3px;" class="ms-globallinks">|</td>
<td valign="middle" class="ms-globallinks">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="ms-globallinks">
<SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm" runat="server"/></td>
<td class="ms-globallinks">
<SharePoint:DelegateControl ControlId="GlobalSiteLink2" Scope="Farm" runat="server"/></td>
</tr>
</table>
</td>
<td valign="middle" class="ms-globallinks">
<img align='absmiddle' border=0 src="/_layouts/images/helpicon.gif" alt="<%$Resources:wss,multipages_helplinkalt_text%>" runat="server">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table id="MainContentsTable" class="mainContentsTable" width="100%">
<tr>
<td class="mainTableLeftColumn">
<!--- --- --- Left Navigation Bar --- --- --->
<!-- Left Nav bar data source -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" runat="server" />
<!-- Area above left nav bar; Used to place profile pic for My Site -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" runat="server"/>
<!-- Calendar date picker -->
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" />
<!-- Quick Launch -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">
<!-- View All Site Content -->
<label class="ms-hidden">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,quiklnch_pagetitle%>" EncodeMethod="HtmlEncode"/></label>
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages"><SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></SharePoint:SPSecurityTrimmedControl>
<!-- Quick Launch Items -->
<Sharepoint:SPNavigationManager
id="QuickLaunchNavigationManager"
runat="server"
QuickLaunchControlId="QuickLaunchMenu"
ContainedControl="QuickLaunch"
EnableViewState="false"><SharePoint:DelegateControl runat="server" ControlId="QuickLaunchDataSource"><Template_Controls>
<asp:SiteMapDataSource SiteMapProvider="SPNavigationProvider" ShowStartingNode="False" id="QuickLaunchSiteMap" StartingNodeUrl="sid:1025" runat="server" />
</Template_Controls>
</SharePoint:DelegateControl><SharePoint:AspMenu id="QuickLaunchMenu" DataSourceId="QuickLaunchSiteMap" runat="server" Orientation="Vertical" StaticDisplayLevels="2" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText=""><LevelMenuItemStyles><asp:menuitemstyle CssClass="ms-navheader" /><asp:menuitemstyle CssClass="ms-navitem" />
</LevelMenuItemStyles><LevelSubMenuStyles><asp:submenustyle CssClass="ms-navSubMenu1" /><asp:submenustyle CssClass="ms-navSubMenu2" />
</LevelSubMenuStyles><LevelSelectedStyles><asp:menuitemstyle CssClass="ms-selectednavheader" /><asp:menuitemstyle CssClass="ms-selectednav" />
</LevelSelectedStyles>
</SharePoint:AspMenu></Sharepoint:SPNavigationManager>
<!--- Tree View --->
<Sharepoint:SPNavigationManager
id="TreeViewNavigationManager"
runat="server"
ContainedControl="TreeView">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchy" Text="<%$Resources:wss,treeview_header%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>" />
<SharePoint:SPHierarchyDataSourceControl runat="server" id="TreeViewDataSource" RootContextObject="Web" IncludeDiscussionFolders="true" />
<SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="javascript:_spRecordScrollPositions(this);" Style="overflow: auto;height: 400px;width: 150px; ">
<SharePoint:SPTreeView id="WebTreeView" runat="server" ShowLines="false" DataSourceId="TreeViewDataSource" ExpandDepth="0" SelectedNodeStyle-CssClass="ms-tvselected" NodeStyle-CssClass="ms-navitem" NodeStyle-HorizontalPadding="2" SkipLinkText="" NodeIndent="12" ExpandImageUrl="/_layouts/images/tvplus.gif" CollapseImageUrl="/_layouts/images/tvminus.gif" NoExpandImageUrl="/_layouts/images/tvblank.gif">
</SharePoint:SPTreeView>
</SharePoint:SPRememberScroll>
</Sharepoint:SPNavigationManager>
<!-- Recycle Bin -->
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems"/>
</asp:ContentPlaceHolder>
<!-- Left nav Actions area -->
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server"/>
<!--- --- --- End of Left Navigation Bar --- --- --->
</td>
<td class="mainTableMiddleColumn">
<!--- --- --- Page Content --- --- --->
<!-- In the wrapper DIV, the ID "MSO_ContentDiv" places the Web Part Tool Pane directly to the right of the content area -->
<div id="MSO_ContentDiv" runat="server">
<A name="mainContent"></A>
<!-- Page Description -->
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
<!-- Main content area -->
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
</asp:ContentPlaceHolder>
</div>
<!--- --- --- End of Page Content --- --- --->
</td>
<td class="mainTableRightColumn">
<asp:ContentPlaceHolder id="PlaceHolderRight" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer" class="footer">
</td>
</tr>
<tr>
<td id="padding" height="100%">
</td>
</tr>
</table>
<input type="text" name="__spDummyText1" style="display:none;" size=1/>
<input type="text" name="__spDummyText2" style="display:none;" size=1/>
</form>
<!--- --- --- Leave the following placeholders beneath all page content --- --- --->
<!-- Footer -->
<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
<!-- Used to add body styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
<!-- Used to add styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
</div>
<!--- --- --- Hidden Placeholders --- --- --->
<asp:Panel visible="false" runat="server" BackColor="White">
<!-- PLACE UNUSED CONTENT PLACEHOLDERS HERE -->
<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle">
<SharePoint:ProjectProperty Property="Title" runat="server" />
</SharePoint:SPLinkButton>
</asp:ContentPlaceHolder>
<!--- --- --- Horizontal Top Navigation Bar --- --- --->
<!-- Container for top bar -->
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
<!-- Top bar-->
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
</asp:ContentPlaceHolder>
<!-- Site Actions Menu -->
</asp:ContentPlaceHolder>
<!--- --- --- End of Horizontal Top Navigation Bar --- --- --->
<!--- --- --- Edit Consoles --- --- --->
<!-- Edit console that appears in page Edit mode -->
<!--- --- --- End of Edit Consoles --- --- --->
<!--- --- --- Page Header --- --- --->
<!-- Page Image -->
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server"/>
<!--- Breadcrumb nav on sub pages --->
<!--- Page Title -->
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
<!-- Mini Console - provides page level commands such as the supplementary buttons for Site Map -->
<asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server"/>
<!--- --- --- End of Page Header --- --- --->
<!-- Form Digest Security Control -->
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
<SharePoint:FormDigest runat="server" />
</asp:ContentPlaceHolder>
<!--- --- Placeholders used in default.master that you will likely not use --- --->
<!-- Area between page image and page title -->
<asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server"/>
<!-- Area between page name and right page border -->
<asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server"/>
<!-- Area between top nav bar and page content -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server"/>
<!-- Sets a width of the left nav bar -->
<asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server"><IMG SRC="/_layouts/images/blank.gif" width=138 height=1 alt=""></asp:ContentPlaceholder>
<!-- Area between left nav bar and page content -->
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server"></asp:ContentPlaceHolder>
<!-- Area between left nav and content -->
<asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server"/>
<!-- Area between content and right page border -->
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server"/>
<!-- Title -->
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
<asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
</asp:ContentPlaceHolder>
<!-- Help Icon -->
</asp:Panel>
<!--- --- --- End of Hidden Placeholders --- --- --->
</BODY>
</HTML>

ASP.NET webform error with JQuery Mobile

Here is my effort for using JQuery mobile with asp.net webform. Below is the code I have used in the Default.aspx page. It's a very simple code
Below is the complete code of the aspx page.
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title> Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js">
</script>
</head>
<body>
<form id="form1" runat="server">
<!-- Start of first page -->
<div data-role="page" id="foo">
<div data-role="header">
<h1>Mobile Login</h1>
</div><!-- /header -->
<div data-role="content">
<table width="100%">
<tr width="100%">
<td width="30%" align="right" valign="middle">
<asp:Literal ID="lblUserName" runat="server" Text="User Name"></asp:Literal>
</td>
<td width="50%">
<input type="text" maxlength="20" id="UserName" style="width:50%;" runat="server" />
</td>
</tr>
<tr width="100%">
<td width="50%" align="right">
<asp:Literal ID="Literal1" runat="server" Text="Password"></asp:Literal>
</td>
<td width="50%">
<input type="text" maxlength="20" id="Password" style="width:50%;" runat="server" />
</td>
</tr>
<tr width="100%">
<td width="50%" align="right">
</td>
<td width="50%">
<table width="100%">
<tr>
<td width="30%">
<asp:Button ID="btnLogin" runat="server" Text="Login"
OnClick="btnLogin_Click" />
</td>
<td width="30%">
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="ui-btn-active"
OnClick="btnCancel_Click" />
</td>
<td width="40%">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div><!-- /content -->
<div data-role="footer">
<h4>
# All right reserved.
</h4>
</div><!-- /footer -->
</div><!-- /page -->
</form>
</body>
</html>
Now on the server side
protected void btnLogin_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx",true);
}
protected void btnCancel_Click(object sender, EventArgs e)
{
UserName.Value = "";
Password.Value = "";
}
but when I am clicking the login/cancel button nothing happen other than the Url is changed from
http://localhost:2278/Mobile/Default.aspx
to
http://localhost:2278/Mobile/Default.aspx#/Mobile/Default.aspx
What is wrong in my code? Can't I access Server side functions from ASP.NET server controls in JQuery Mobile? I am aware that it can be done better in MVC but that's not a option for me in this case.
Please help
This is because .net adds type="submit" to Button control by default. You need to set that to false and I would also set CausesValidation to false too, like this:
<asp:Button ID="btnLogin" runat="server" Text="Login"
OnClick="btnLogin_Click" CausesValidation="False" UseSubmitBehavior="False" />
in all fairness however, I wouldn't have used a server-side event just to navigate away on button click. You can achieve that with much easier way:
Login
..that's, of course, assuming you don't have to do any other server-side operations before navigating away.

Resources