Solved

asp.net webform

Posted on 2008-10-29
4
404 Views
Last Modified: 2013-11-26
I am developing a asp.net website using visual basic 2008 I am using html not server controls to navigate from one webform to another. I want to somehow capture the event clicking of the html link so I can determine what webform is opening so that I can save the appropiate session variables. The problem is using html links to navigate I have no idea how to accomplish that. So any help on trying to figure this out would greatly be appreciated
0
Comment
Question by:lothos123452000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
smokingspaceman earned 500 total points
ID: 22837746
You mean you use HTML <a> tags for navigation?
If so make change the runat attribute of the <a> tag to server.
<a id="link" href="sdfs.aspx" runat="server">link</a>

And you can add an event handler to the on click event of that control;
    Protected Sub link_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles link.ServerClick
0
 

Author Comment

by:lothos123452000
ID: 22838063
What if my html looks like the following

<li><a href="ContactUs.aspx" runat="server">Contact Us</a></li>

I have a space between Contact and Us it is not working plus I get the following error

"Handles clause requires a WithEvents variable defined in the containing type or one of its base types."
0
 

Author Closing Comment

by:lothos123452000
ID: 31511529
Never mind about my second post your suggestion worked great! Thanks for the help.
0
 
LVL 2

Expert Comment

by:smokingspaceman
ID: 22838073
The problem is you dont have an Id for your <a> tag.
It should be
<li><a id="contactUs" href="ContactUs.aspx" runat="server">Contact Us</a></li>
and
Protected Sub link_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles contactUs.ServerClick
0

Featured Post

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question