Rai Yawar Ijaz

blog

  Home  |   Contact  |   Syndication    |   Login
  6 Posts | 3 Stories | 11 Comments | 34 Trackbacks

News

Article Categories

Archives

Post Categories

I just have notices that you can't access hyperlink as usually you access other serverside controls.

Suppose there is a Server side TextBox named “txtBox”

you will Access it in javaScript as

[document_name].[form_name].[Control_name].value

document.form.txtBox.value

here is assume that the name of my Server Side Text box is “txtBox“ and the name of my Form is “form“

okie this is the normal procedure . you can't Access Server Side in the same fashion. As it is rendered as  <a> in the HTML so u have to send the function with the clientID parameter when want to access a hyperlink

your Code behind Code

Form_Load()

{

[ControlName].Attributes.Add(“OnClick“,“validate(“ + [ControlName].ClientID + “)“);

}

your Scripted Code

<script>

function validate(clientID)

{

var control=document.form.getElementById(clientid);

var.href=“ure specified url“ // or wat ever u want to do .

}

</script>

if you experience any problem in using the CODE just write me a mail on raiyawar@gmail.com

 

 

posted on Friday, November 12, 2004 3:05 PM

Feedback

# re: problems in Accessing ServersSde Hyperlink in javascript 8/17/2005 4:32 AM Firose Babu
Very good yah and helpful

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: