|
-
May 11th, 2008, 02:49 PM
#1
Thread Starter
Hyperactive Member
html and asp.net
Hey guys I am trying to use a html anchor tag with asp.net
here is the code
Code:
Protected Sub linkadd_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles linkadd.ServerClick
Session("adduser") = "true"
MsgBox(Session("adduser"))
End Sub
Here is my html
<li><a href="ChangeUser.aspx" id="linkadd" runat=server>Add User</a></li>
When I run the page it is running the error
do post back is not defined
javascript dopastback("linkadd")
Last edited by tarik666; May 11th, 2008 at 02:52 PM.
-
May 12th, 2008, 04:52 AM
#2
Re: html and asp.net
There's an ASP.Net specific serverside control named LinkButton which you'll want to use:
Code:
<li><asp:linkbutton id="linkadd" runat="server"
href="ChangeUser.aspx">Add User</asp:linkbutton></li>
-
May 12th, 2008, 10:12 AM
#3
Re: html and asp.net
I would suggest against using a Post Back for a hyperlink. Postbacks are typically synonymous with a button where as hyperlinks typically take you somewhere else.
Sorry, just trying to rid the world of evil one post back at a time
-
May 12th, 2008, 03:59 PM
#4
Re: html and asp.net
If you have the location defined - changeuser.aspx - then you don't need to perform your postback. If you need to pass other info to the next page, consider appending that in the querystring if it's not sensitive information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|