Link to home
Start Free TrialLog in
Avatar of gmayo
gmayoFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VS2008 ASP.NET Web App, no xxx.asp.designer.cs created

I've only just started dabbling in VS2008 for creating an ASP website (hand coded before!) but when I "add new item" and select "web form" it creates default.aspx and default.aspx.cs underneath it, but there is no default.asp.designer.cs alongside. Instead, if I try to add an event to the web page in designer view I get nasty Javascript embedded in the ASP page.

What am I doing wrong?
<script language="javascript" type="text/javascript">
// <!CDATA[

        function Button1_onclick() {

        }

// ]]>
    </script>

Open in new window

Avatar of gmayo
gmayo
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Instead of Javascript embedded in the ASP page I want it to call code in the server side CS file like the code snippet attached.

The web form designer - the bit I'm missing - should have the following line (auto generated, of course):
this.cmdSignOut.ServerClick += new System.EventHandler(this.cmdSignOut_ServerClick);

Thanks.
private void cmdSignOut_ServerClick(object sender, System.EventArgs e)
{
   FormsAuthentication.SignOut();
   Response.Redirect("logon.aspx", true);
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Todd Gerbert
Todd Gerbert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gmayo

ASKER

I simply had the wrong project type.