|
Hello All:
I'm sure that one of you can quickly spot the error in my script. I am
using a small javascript function to retrieve the text of a hyperlink in a
datagrid column.
Here is my script:
function parseHyperlinkId(o) {
alert(o.text);
alert(o.href);
alert(o.target);
return true;
}
using the following Server side code to link the hyperlink's onClick event
to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text
returns "undefined." Does anyone know which property I should use to
retrieve the hyperlink's text?
TIA,
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | |
Share:
|
dont think it is...
change this:
function parseHyperlinkId(o) {
alert(o.text);
alert(o.href);
alert(o.target);
return true;
}
to this:
function parseHyperlinkId(url,text) {
alert(url);
alert(text);
return true;
}
and have the onClick like this:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);")
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Joe" wrote: Hello All:
I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column.
Here is my script:
function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
using the following Server side code to link the hyperlink's onClick event to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text returns "undefined." Does anyone know which property I should use to retrieve the hyperlink's text?
TIA,
-- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
Curt,
This doesn't help. I can't pass in yourText if I can't retrieve the
hyperlink's text.
How do I get yourText? Please post the code.
Joe
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote: dont think it is... change this: function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
to this:
function parseHyperlinkId(url,text) { alert(url); alert(text); return true; }
and have the onClick like this: hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);")
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
Hello All:
I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column.
Here is my script:
function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
using the following Server side code to link the hyperlink's onClick event to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text returns "undefined." Does anyone know which property I should use to retrieve the hyperlink's text?
TIA,
-- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
where are you getting the values that you put into the text? Are you reading
them from a DB? When you write them to the datagrid you can write them to the
javascript as well.....
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Joe" wrote: Curt,
This doesn't help. I can't pass in yourText if I can't retrieve the hyperlink's text.
How do I get yourText? Please post the code.
Joe -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
dont think it is... change this: function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
to this:
function parseHyperlinkId(url,text) { alert(url); alert(text); return true; }
and have the onClick like this: hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);")
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
Hello All:
I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column.
Here is my script:
function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
using the following Server side code to link the hyperlink's onClick event to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text returns "undefined." Does anyone know which property I should use to retrieve the hyperlink's text?
TIA,
-- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
The hyuperlinks are contained within the hyperlink column of a datagrid which
is databound to a datatable. They are retrieved from a database, but are
immediately bound to the datagrid, so I do not have directa ccess to them.
Do you know of a way to retrieve the text from a hyperlink after the link
has been created?
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote: where are you getting the values that you put into the text? Are you reading them from a DB? When you write them to the datagrid you can write them to the javascript as well.....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
Curt,
This doesn't help. I can't pass in yourText if I can't retrieve the hyperlink's text.
How do I get yourText? Please post the code.
Joe -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
dont think it is... change this: function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
to this:
function parseHyperlinkId(url,text) { alert(url); alert(text); return true; }
and have the onClick like this: hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);")
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
> Hello All: > > I'm sure that one of you can quickly spot the error in my script. I am > using a small javascript function to retrieve the text of a hyperlink in a > datagrid column. > > Here is my script: > > function parseHyperlinkId(o) { > alert(o.text); > alert(o.href); > alert(o.target); > return true; > } > > using the following Server side code to link the hyperlink's onClick event > to the javascript: > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);") > > o.target returns the hyperlink's target; o.href returns the href; o.text > returns "undefined." Does anyone know which property I should use to > retrieve the hyperlink's text? > > TIA, > > -- > Joe > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
I might be totally off base here, but have you tried o.innerHtml
instead of o.text? Once you're at the browser, we're pretty much back
to basic HTML elements, which don't include the .text property.
For instance, you used .href instead of .NavigateUrl.
Something to try while you wait for the experts to come along and
answer correctly. :) | | |
joe,
text is not an HTML attribute.. it is innerText
try alert(o.innerText);
"Joe" wrote: Hello All:
I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column.
Here is my script:
function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
using the following Server side code to link the hyperlink's onClick event to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text returns "undefined." Does anyone know which property I should use to retrieve the hyperlink's text?
TIA,
-- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
not without postback
We went through your options yesterday really.. I mean you will HAVE to
change something in the way you are doing it....
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Joe" wrote: The hyuperlinks are contained within the hyperlink column of a datagrid which is databound to a datatable. They are retrieved from a database, but are immediately bound to the datagrid, so I do not have directa ccess to them.
Do you know of a way to retrieve the text from a hyperlink after the link has been created? -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
where are you getting the values that you put into the text? Are you reading them from a DB? When you write them to the datagrid you can write them to the javascript as well.....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
Curt,
This doesn't help. I can't pass in yourText if I can't retrieve the hyperlink's text.
How do I get yourText? Please post the code.
Joe -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
> dont think it is... > change this: > function parseHyperlinkId(o) { > alert(o.text); > alert(o.href); > alert(o.target); > return true; > } > > to this: > > function parseHyperlinkId(url,text) { > alert(url); > alert(text); > return true; > } > > and have the onClick like this: > hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);") > > > -- > Curt Christianson > site: http://www.darkfalz.com > blog: http://blog.darkfalz.com > > > > "Joe" wrote: > > > Hello All: > > > > I'm sure that one of you can quickly spot the error in my script. I am > > using a small javascript function to retrieve the text of a hyperlink in a > > datagrid column. > > > > Here is my script: > > > > function parseHyperlinkId(o) { > > alert(o.text); > > alert(o.href); > > alert(o.target); > > return true; > > } > > > > using the following Server side code to link the hyperlink's onClick event > > to the javascript: > > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);") > > > > o.target returns the hyperlink's target; o.href returns the href; o.text > > returns "undefined." Does anyone know which property I should use to > > retrieve the hyperlink's text? > > > > TIA, > > > > -- > > Joe > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
Exactly. Thanks.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Sreejith Ram" wrote: joe,
text is not an HTML attribute.. it is innerText try alert(o.innerText);
"Joe" wrote:
Hello All:
I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column.
Here is my script:
function parseHyperlinkId(o) { alert(o.text); alert(o.href); alert(o.target); return true; }
using the following Server side code to link the hyperlink's onClick event to the javascript:
hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);")
o.target returns the hyperlink's target; o.href returns the href; o.text returns "undefined." Does anyone know which property I should use to retrieve the hyperlink's text?
TIA,
-- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
You are exactly right! Thanks..
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Phillip Ian" wrote: I might be totally off base here, but have you tried o.innerHtml instead of o.text? Once you're at the browser, we're pretty much back to basic HTML elements, which don't include the .text property.
For instance, you used .href instead of .NavigateUrl.
Something to try while you wait for the experts to come along and answer correctly. :)
| | |
Curt,
In fact I don't have to change anything.
I don't know why others seem to understand my questions and you do not.
Postback was never needed here; the innerText property of the hyperlink is
what I needed.
Unfortunately, both your responses today and your responses yesterday never
really addressed my question. They were either entiredly too vague or
completely off of the mark. I was not asking for architectural
recommendations; I asked a simple question that required a simple answer.
I would like to ask a favor of you. In the future, if you see one of my
posts, please please, please, please, please do NOT respond to my request for
help.
I will very much appreciate your consideration.
Thank you and best of luck to you.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote: not without postback We went through your options yesterday really.. I mean you will HAVE to change something in the way you are doing it....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
The hyuperlinks are contained within the hyperlink column of a datagrid which is databound to a datatable. They are retrieved from a database, but are immediately bound to the datagrid, so I do not have directa ccess to them.
Do you know of a way to retrieve the text from a hyperlink after the link has been created? -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
where are you getting the values that you put into the text? Are you reading them from a DB? When you write them to the datagrid you can write them to the javascript as well.....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
> Curt, > > This doesn't help. I can't pass in yourText if I can't retrieve the > hyperlink's text. > > How do I get yourText? Please post the code. > > Joe > -- > Joe > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation > > > "Curt_C [MVP]" wrote: > > > dont think it is... > > change this: > > function parseHyperlinkId(o) { > > alert(o.text); > > alert(o.href); > > alert(o.target); > > return true; > > } > > > > to this: > > > > function parseHyperlinkId(url,text) { > > alert(url); > > alert(text); > > return true; > > } > > > > and have the onClick like this: > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);") > > > > > > -- > > Curt Christianson > > site: http://www.darkfalz.com > > blog: http://blog.darkfalz.com > > > > > > > > "Joe" wrote: > > > > > Hello All: > > > > > > I'm sure that one of you can quickly spot the error in my script. I am > > > using a small javascript function to retrieve the text of a hyperlink in a > > > datagrid column. > > > > > > Here is my script: > > > > > > function parseHyperlinkId(o) { > > > alert(o.text); > > > alert(o.href); > > > alert(o.target); > > > return true; > > > } > > > > > > using the following Server side code to link the hyperlink's onClick event > > > to the javascript: > > > > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);") > > > > > > o.target returns the hyperlink's target; o.href returns the href; o.text > > > returns "undefined." Does anyone know which property I should use to > > > retrieve the hyperlink's text? > > > > > > TIA, > > > > > > -- > > > Joe > > > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
When you post to a SERVER SIDE TECHNOLOGY group what do you expect to get?
Dont worry about be not posting to your questions, your last post made it
clear you aren't capable of help.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Joe" wrote: Curt,
In fact I don't have to change anything.
I don't know why others seem to understand my questions and you do not. Postback was never needed here; the innerText property of the hyperlink is what I needed.
Unfortunately, both your responses today and your responses yesterday never really addressed my question. They were either entiredly too vague or completely off of the mark. I was not asking for architectural recommendations; I asked a simple question that required a simple answer.
I would like to ask a favor of you. In the future, if you see one of my posts, please please, please, please, please do NOT respond to my request for help.
I will very much appreciate your consideration.
Thank you and best of luck to you. -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
not without postback We went through your options yesterday really.. I mean you will HAVE to change something in the way you are doing it....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
The hyuperlinks are contained within the hyperlink column of a datagrid which is databound to a datatable. They are retrieved from a database, but are immediately bound to the datagrid, so I do not have directa ccess to them.
Do you know of a way to retrieve the text from a hyperlink after the link has been created? -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
> where are you getting the values that you put into the text? Are you reading > them from a DB? When you write them to the datagrid you can write them to the > javascript as well..... > > -- > Curt Christianson > site: http://www.darkfalz.com > blog: http://blog.darkfalz.com > > > > "Joe" wrote: > > > Curt, > > > > This doesn't help. I can't pass in yourText if I can't retrieve the > > hyperlink's text. > > > > How do I get yourText? Please post the code. > > > > Joe > > -- > > Joe > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation > > > > > > "Curt_C [MVP]" wrote: > > > > > dont think it is... > > > change this: > > > function parseHyperlinkId(o) { > > > alert(o.text); > > > alert(o.href); > > > alert(o.target); > > > return true; > > > } > > > > > > to this: > > > > > > function parseHyperlinkId(url,text) { > > > alert(url); > > > alert(text); > > > return true; > > > } > > > > > > and have the onClick like this: > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);") > > > > > > > > > -- > > > Curt Christianson > > > site: http://www.darkfalz.com > > > blog: http://blog.darkfalz.com > > > > > > > > > > > > "Joe" wrote: > > > > > > > Hello All: > > > > > > > > I'm sure that one of you can quickly spot the error in my script. I am > > > > using a small javascript function to retrieve the text of a hyperlink in a > > > > datagrid column. > > > > > > > > Here is my script: > > > > > > > > function parseHyperlinkId(o) { > > > > alert(o.text); > > > > alert(o.href); > > > > alert(o.target); > > > > return true; > > > > } > > > > > > > > using the following Server side code to link the hyperlink's onClick event > > > > to the javascript: > > > > > > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);") > > > > > > > > o.target returns the hyperlink's target; o.href returns the href; o.text > > > > returns "undefined." Does anyone know which property I should use to > > > > retrieve the hyperlink's text? > > > > > > > > TIA, > > > > > > > > -- > > > > Joe > > > > > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | |
Curt,
I am writing to apologize to both you and the MSDN community for my personal
attack on you in this forum. I take full responsibility for what I wrote and
was wrong to do so. I will make every effort not to repeat my violation of
the rules of conduct and I hope that both you and the members of this
community can and will forgive me.
Regarding my not being "capable of help." The other posts answered my
questions and provided the information that I requested. So I disagree; the
evidence suggests otherwise.
Again, thank you for your time and consideration. I appreciate your
willingness to respect my wish. We clearly do not communicate well.
I wish you all the best.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote: When you post to a SERVER SIDE TECHNOLOGY group what do you expect to get?
Dont worry about be not posting to your questions, your last post made it clear you aren't capable of help.
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
Curt,
In fact I don't have to change anything.
I don't know why others seem to understand my questions and you do not. Postback was never needed here; the innerText property of the hyperlink is what I needed.
Unfortunately, both your responses today and your responses yesterday never really addressed my question. They were either entiredly too vague or completely off of the mark. I was not asking for architectural recommendations; I asked a simple question that required a simple answer.
I would like to ask a favor of you. In the future, if you see one of my posts, please please, please, please, please do NOT respond to my request for help.
I will very much appreciate your consideration.
Thank you and best of luck to you. -- Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Curt_C [MVP]" wrote:
not without postback We went through your options yesterday really.. I mean you will HAVE to change something in the way you are doing it....
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com "Joe" wrote:
> The hyuperlinks are contained within the hyperlink column of a datagrid which > is databound to a datatable. They are retrieved from a database, but are > immediately bound to the datagrid, so I do not have directa ccess to them. > > Do you know of a way to retrieve the text from a hyperlink after the link > has been created? > -- > Joe > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation > > > "Curt_C [MVP]" wrote: > > > where are you getting the values that you put into the text? Are you reading > > them from a DB? When you write them to the datagrid you can write them to the > > javascript as well..... > > > > -- > > Curt Christianson > > site: http://www.darkfalz.com > > blog: http://blog.darkfalz.com > > > > > > > > "Joe" wrote: > > > > > Curt, > > > > > > This doesn't help. I can't pass in yourText if I can't retrieve the > > > hyperlink's text. > > > > > > How do I get yourText? Please post the code. > > > > > > Joe > > > -- > > > Joe > > > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation > > > > > > > > > "Curt_C [MVP]" wrote: > > > > > > > dont think it is... > > > > change this: > > > > function parseHyperlinkId(o) { > > > > alert(o.text); > > > > alert(o.href); > > > > alert(o.target); > > > > return true; > > > > } > > > > > > > > to this: > > > > > > > > function parseHyperlinkId(url,text) { > > > > alert(url); > > > > alert(text); > > > > return true; > > > > } > > > > > > > > and have the onClick like this: > > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(yourURL,yourText);") > > > > > > > > > > > > -- > > > > Curt Christianson > > > > site: http://www.darkfalz.com > > > > blog: http://blog.darkfalz.com > > > > > > > > > > > > > > > > "Joe" wrote: > > > > > > > > > Hello All: > > > > > > > > > > I'm sure that one of you can quickly spot the error in my script. I am > > > > > using a small javascript function to retrieve the text of a hyperlink in a > > > > > datagrid column. > > > > > > > > > > Here is my script: > > > > > > > > > > function parseHyperlinkId(o) { > > > > > alert(o.text); > > > > > alert(o.href); > > > > > alert(o.target); > > > > > return true; > > > > > } > > > > > > > > > > using the following Server side code to link the hyperlink's onClick event > > > > > to the javascript: > > > > > > > > > > hLink.Attributes.Add("onClick", "return parseHyperlinkId(this);") > > > > > > > > > > o.target returns the hyperlink's target; o.href returns the href; o.text > > > > > returns "undefined." Does anyone know which property I should use to > > > > > retrieve the hyperlink's text? > > > > > > > > > > TIA, > > > > > > > > > > -- > > > > > Joe > > > > > > > > > > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation | | This discussion thread is closed Replies have been disabled for this discussion. |