Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Thursday, March 29, 2012

Pass parameters to User Control

Hi

I am using a User Control which is referenced by an ASPX page.

How can I pass a string parameter to the user control, from the base ASPX
page.

Thanks

BenHi Ben,

Create a public method in the usercontrol and access the same from the aspx
page.

Ex:

Code in myusercontrol.ascx.cs
public void PublicMethodInUsercontrol(string valuetopasstocontrol)
{
privatevariable = valuetopasstocontrol;
}

Code in the aspx page.

usercontrolinstance.PublicMethodInUsercontrol("MyValueFromPage");

HTH
Regards
Ashish M Bhonkiya

"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben
For this purpose I used to create properties (in user control). This way you
can also pass parameters from aspx file (html).
You can access Session to retrieve values. There're plenty of ways. In case
you need some code, I'll try to post.

--
With the best wishes,
Shaul Feldman
"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben
Sorry for the delay in replying:

I have heard that you can use this method to pass the parameter:

<%@.Register tagprefix="CodeLib" Tagname="usrMain" src="http://pics.10026.com/?src=usrMain.ascx" %
<CodeLib:usrMain bodyData="usrText.ascx" linksPage="NoLinks"
requireSecure="False" runat="server" ID="usrMain"/
But the problem is that I cannot seem to extract the data on the ASCX page

Thanks Ben

"Shaul Feldman" <sfeldman@.writeme.com> wrote in message
news:e$%23BiHkJEHA.3944@.tk2msftngp13.phx.gbl...
> For this purpose I used to create properties (in user control). This way
you
> can also pass parameters from aspx file (html).
> You can access Session to retrieve values. There're plenty of ways. In
case
> you need some code, I'll try to post.
> --
> With the best wishes,
> Shaul Feldman
> "Ben" <Ben@.nospam.com> wrote in message
> news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> > Hi
> > I am using a User Control which is referenced by an ASPX page.
> > How can I pass a string parameter to the user control, from the base
ASPX
> > page.
> > Thanks
> > Ben
Help! I have an aspx that loads the ascx with parameters in a
placeholder as textboxes. On my postback I can't get the values out
of the textboxes. They are still on the screen so I'm sure they are
there.

I'm having a hard time. I've been told they should just be there.
aspx
ascx
ascxwp

The ascxwp is the user control that holds the textboxes.

I assume someone has figured this out. We have 3 asp programmers and
we are all stumped.

"Shaul Feldman" <sfeldman@.writeme.com> wrote in message news:<e$#BiHkJEHA.3944@.tk2msftngp13.phx.gbl>...
> For this purpose I used to create properties (in user control). This way you
> can also pass parameters from aspx file (html).
> You can access Session to retrieve values. There're plenty of ways. In case
> you need some code, I'll try to post.
> --
> With the best wishes,
> Shaul Feldman
> "Ben" <Ben@.nospam.com> wrote in message
> news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> > Hi
> > I am using a User Control which is referenced by an ASPX page.
> > How can I pass a string parameter to the user control, from the base ASPX
> > page.
> > Thanks
> > Ben
Implement Properties inside of your UserControl
e.g.

Public Property FirstName() as String
Get
Return txtFirstName.text
End Get
Set (value as String)
txtFirstName.text=value
end set
end property

Then just access the properties
"Lynne K." <ltgaer@.assurity.com> wrote in message
news:7a65e5b4.0405110605.559f0d2d@.posting.google.c om...
> Help! I have an aspx that loads the ascx with parameters in a
> placeholder as textboxes. On my postback I can't get the values out
> of the textboxes. They are still on the screen so I'm sure they are
> there.
> I'm having a hard time. I've been told they should just be there.
> aspx
> ascx
> ascxwp
> The ascxwp is the user control that holds the textboxes.
> I assume someone has figured this out. We have 3 asp programmers and
> we are all stumped.
> "Shaul Feldman" <sfeldman@.writeme.com> wrote in message
news:<e$#BiHkJEHA.3944@.tk2msftngp13.phx.gbl>...
> > For this purpose I used to create properties (in user control). This way
you
> > can also pass parameters from aspx file (html).
> > You can access Session to retrieve values. There're plenty of ways. In
case
> > you need some code, I'll try to post.
> > --
> > With the best wishes,
> > Shaul Feldman
> > "Ben" <Ben@.nospam.com> wrote in message
> > news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> > > Hi
> > > > I am using a User Control which is referenced by an ASPX page.
> > > > How can I pass a string parameter to the user control, from the base
ASPX
> > > page.
> > > > Thanks
> > > > Ben
> >

Pass parameters to User Control

Hi
I am using a User Control which is referenced by an ASPX page.
How can I pass a string parameter to the user control, from the base ASPX
page.
Thanks
BenHi Ben,
Create a public method in the usercontrol and access the same from the aspx
page.
Ex:
Code in myusercontrol.ascx.cs
public void PublicMethodInUsercontrol(string valuetopasstocontrol)
{
privatevariable = valuetopasstocontrol;
}
Code in the aspx page.
usercontrolinstance.PublicMethodInUsercontrol("MyValueFromPage");
HTH
Regards
Ashish M Bhonkiya
"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben
>
For this purpose I used to create properties (in user control). This way you
can also pass parameters from aspx file (html).
You can access Session to retrieve values. There're plenty of ways. In case
you need some code, I'll try to post.
With the best wishes,
Shaul Feldman
"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben
>
Sorry for the delay in replying:
I have heard that you can use this method to pass the parameter:
<%@.Register tagprefix="CodeLib" Tagname="usrMain" src="http://pics.10026.com/?src=usrMain.ascx" %>
<CodeLib:usrMain bodyData="usrText.ascx" linksPage="NoLinks"
requireSecure="False" runat="server" ID="usrMain"/>
But the problem is that I cannot seem to extract the data on the ASCX page
Thanks Ben
"Shaul Feldman" <sfeldman@.writeme.com> wrote in message
news:e$%23BiHkJEHA.3944@.tk2msftngp13.phx.gbl...
> For this purpose I used to create properties (in user control). This way
you
> can also pass parameters from aspx file (html).
> You can access Session to retrieve values. There're plenty of ways. In
case
> you need some code, I'll try to post.
> --
> With the best wishes,
> Shaul Feldman
> "Ben" <Ben@.nospam.com> wrote in message
> news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
ASPX
>
Implement Properties inside of your UserControl
e.g.
Public Property FirstName() as String
Get
Return txtFirstName.text
End Get
Set (value as String)
txtFirstName.text=value
end set
end property
Then just access the properties
"Lynne K." <ltgaer@.assurity.com> wrote in message
news:7a65e5b4.0405110605.559f0d2d@.posting.google.com...
> Help! I have an aspx that loads the ascx with parameters in a
> placeholder as textboxes. On my postback I can't get the values out
> of the textboxes. They are still on the screen so I'm sure they are
> there.
> I'm having a hard time. I've been told they should just be there.
> aspx
> ascx
> ascxwp
> The ascxwp is the user control that holds the textboxes.
> I assume someone has figured this out. We have 3 asp programmers and
> we are all stumped.
> "Shaul Feldman" <sfeldman@.writeme.com> wrote in message
news:<e$#BiHkJEHA.3944@.tk2msftngp13.phx.gbl>...
you
case
ASPX

Pass parameters to User Control

Hi

I am using a User Control which is referenced by an ASPX page.

How can I pass a string parameter to the user control, from the base ASPX
page.

Thanks

BenHi Ben,

Create a public method in the usercontrol and access the same from the aspx
page.

Ex:

Code in myusercontrol.ascx.cs
public void PublicMethodInUsercontrol(string valuetopasstocontrol)
{
privatevariable = valuetopasstocontrol;
}

Code in the aspx page.

usercontrolinstance.PublicMethodInUsercontrol("MyValueFromPage");

HTH
Regards
Ashish M Bhonkiya

"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben
For this purpose I used to create properties (in user control). This way you
can also pass parameters from aspx file (html).
You can access Session to retrieve values. There're plenty of ways. In case
you need some code, I'll try to post.

--
With the best wishes,
Shaul Feldman
"Ben" <Ben@.nospam.com> wrote in message
news:u4tZ4ShJEHA.1764@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using a User Control which is referenced by an ASPX page.
> How can I pass a string parameter to the user control, from the base ASPX
> page.
> Thanks
> Ben

Monday, March 26, 2012

Pass the name into HTM file

Hi All,
I have an HTML which I load as string and send it via MailMessage class.
oMailMessage.Body = cHTMLString
Before it is sent as e-mail I need to pass the HTM file the user
First and Last in the first line.
It is a form where the user enters his/her details and then it is
e-mailed the user with the HTM file within the e-mail's body.
It would start like:
Hi Steve Smith,
How can I embed the First and Last name of the user into the htm file?
Thanks,
Joe"JoeP" <DF_XYZ@.hotmail.com> wrote in message
news:ug8bTf5XHHA.4220@.TK2MSFTNGP03.phx.gbl...

> I have an HTML which I load as string and send it via MailMessage class.
> oMailMessage.Body = cHTMLString
> Before it is sent as e-mail I need to pass the HTM file the user
> First and Last in the first line.
> It is a form where the user enters his/her details and then it is
> e-mailed the user with the HTM file within the e-mail's body.
> It would start like:
> Hi Steve Smith,
> How can I embed the First and Last name of the user into the htm file?
oMailMessage.Body = "Hi " + txtFirstName.Text + " " + txtLastName.Text +
",\r\n\r\n";
oMailMessage.Body += cHTMLString;
Hi Mark,
Thanks for your reply. But how do I keep the Verdana font of that embeded
string?
Also the semi column was a problem and got an err which is: Character is not
valid
oMailMessage.Body = "Hi " + txtFirstName.Text + " " + txtLastName.Text +
",\r\n\r\n";
oMailMessage.Body += cHTMLString;
Thanks,
Joe
"JoeP" <DF_XYZ@.hotmail.com> wrote in message
news:OjyJY8$XHHA.992@.TK2MSFTNGP04.phx.gbl...

> Thanks for your reply. But how do I keep the Verdana font of that embeded
> string?
oMailMessage.IsBodyHtml = true;

> Also the semi column was a problem and got an err which is: Character is
> not valid
Ah - I assumed you were using C#...
If you're using VB.NET, you'll (probably) need to do something like:
oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
vbCrLf & vbCrLf
oMailMessage.Body = oMailMessage.Body & cHTMLString
oMailMessage.IsBodyHtml = True
Hi Mark,
Your idea works as well, but even though: oMailMessage.IsBodyHtml = True
The fornt of the below is not the same any more:
oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
vbCrLf & vbCrLf
What I did is: In the first line of the HTM file I did as follows:
Hi {First Name} {Last Name},
Then:
cHTMLString = cHTMLString.Replace("{First Name}", txtFName.Text)
cHTMLString = cHTMLString.Replace("{Last Name}", txtLName.Text)
Thanks,
Joe
Hi,
Actually solution was simple just add font tag in html
like
oMailMessage.Body = "Hi <font face=verdana size=10>" & txtFirstName.Text & "
" & txtLastName.Text & ""
vbCrLf & vbCrLf
oMailMessage.Body = oMailMessage.Body & cHTMLString
oMailMessage.IsBodyHtml = True
it will definately work
cheers
Chetan Chaphekar
"JoeP" wrote:

> Hi Mark,
> Your idea works as well, but even though: oMailMessage.IsBodyHtml = True
> The fornt of the below is not the same any more:
> oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
> vbCrLf & vbCrLf
> What I did is: In the first line of the HTM file I did as follows:
> Hi {First Name} {Last Name},
> Then:
> cHTMLString = cHTMLString.Replace("{First Name}", txtFName.Text)
> cHTMLString = cHTMLString.Replace("{Last Name}", txtLName.Text)
> Thanks,
> Joe
"Chetan Chaphekar" <ChetanChaphekar@.discussions.microsoft.com> wrote in
message news:F8362751-1E99-4F82-B043-D3D44F0A120F@.microsoft.com...

> it will definately work
As far as you are concerned, it will definitely work...
However, you need to think quite carefully about sending HTML emails...
Most modern mail software can be configured not only to strip out all HTML
content, but also to reject emails with HTML content...
Depending on how paranoid / security-conscious your recipients are, they
might never even see your emails if you send them in HTML format...
Hi Mark,
The problem is that I have some links in that HTM file. So I how can I
provide those links without any HTM code. Otherwise the user will need to
copy the URL into the Browser. Not that productive.
Regards,
Joe
"JoeP" <DF_XYZ@.hotmail.com> wrote in message
news:OCnYUOPYHHA.3268@.TK2MSFTNGP04.phx.gbl...

> The problem is that I have some links in that HTM file. So I how can I
> provide those links without any HTM code.
You can't...

> Otherwise the user will need to copy the URL into the Browser.
That's true.

> Not that productive.
Even less productive if the email gets rejected by the user's mail client
before the user even has a chance to see it...
Your call...
Hi Joep,
What mark has said is right but also consider the percentage of receipient
who has this kind of settings. almost all sites who send newsletter to the
subscriber use HTML code in their email.
cheers
chetan chaphekar
"JoeP" wrote:

> Hi Mark,
> The problem is that I have some links in that HTM file. So I how can I
> provide those links without any HTM code. Otherwise the user will need to
> copy the URL into the Browser. Not that productive.
> Regards,
> Joe
>
>

Pass the name into HTM file

Hi All,

I have an HTML which I load as string and send it via MailMessage class.
oMailMessage.Body = cHTMLString

Before it is sent as e-mail I need to pass the HTM file the user

First and Last in the first line.

It is a form where the user enters his/her details and then it is

e-mailed the user with the HTM file within the e-mail's body.

It would start like:

Hi Steve Smith,

How can I embed the First and Last name of the user into the htm file?

Thanks,

Joe

"JoeP" <DF_XYZ@.hotmail.comwrote in message
news:ug8bTf5XHHA.4220@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

I have an HTML which I load as string and send it via MailMessage class.
oMailMessage.Body = cHTMLString
>
Before it is sent as e-mail I need to pass the HTM file the user
First and Last in the first line.
>
It is a form where the user enters his/her details and then it is
e-mailed the user with the HTM file within the e-mail's body.
>
It would start like:
>
Hi Steve Smith,
>
How can I embed the First and Last name of the user into the htm file?


oMailMessage.Body = "Hi " + txtFirstName.Text + " " + txtLastName.Text +
",\r\n\r\n";
oMailMessage.Body += cHTMLString;
Hi Mark,

Thanks for your reply. But how do I keep the Verdana font of that embeded
string?
Also the semi column was a problem and got an err which is: Character is not
valid

oMailMessage.Body = "Hi " + txtFirstName.Text + " " + txtLastName.Text +
",\r\n\r\n";
oMailMessage.Body += cHTMLString;

Thanks,

Joe
"JoeP" <DF_XYZ@.hotmail.comwrote in message
news:OjyJY8$XHHA.992@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Thanks for your reply. But how do I keep the Verdana font of that embeded
string?


oMailMessage.IsBodyHtml = true;

Quote:

Originally Posted by

Also the semi column was a problem and got an err which is: Character is
not valid


Ah - I assumed you were using C#...

If you're using VB.NET, you'll (probably) need to do something like:

oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
vbCrLf & vbCrLf
oMailMessage.Body = oMailMessage.Body & cHTMLString

oMailMessage.IsBodyHtml = True
Hi Mark,

Your idea works as well, but even though: oMailMessage.IsBodyHtml = True
The fornt of the below is not the same any more:

oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
vbCrLf & vbCrLf

What I did is: In the first line of the HTM file I did as follows:
Hi {First Name} {Last Name},

Then:
cHTMLString = cHTMLString.Replace("{First Name}", txtFName.Text)

cHTMLString = cHTMLString.Replace("{Last Name}", txtLName.Text)

Thanks,

Joe
Hi,
Actually solution was simple just add font tag in html
like

oMailMessage.Body = "Hi <font face=verdana size=10>" & txtFirstName.Text & "
" & txtLastName.Text & "</font>"
vbCrLf & vbCrLf
oMailMessage.Body = oMailMessage.Body & cHTMLString

oMailMessage.IsBodyHtml = True

it will definately work

cheers
Chetan Chaphekar

"JoeP" wrote:

Quote:

Originally Posted by

Hi Mark,
>
Your idea works as well, but even though: oMailMessage.IsBodyHtml = True
The fornt of the below is not the same any more:
>
oMailMessage.Body = "Hi " & txtFirstName.Text & " " & txtLastName.Text &
vbCrLf & vbCrLf
>
What I did is: In the first line of the HTM file I did as follows:
Hi {First Name} {Last Name},
>
Then:
cHTMLString = cHTMLString.Replace("{First Name}", txtFName.Text)
>
cHTMLString = cHTMLString.Replace("{Last Name}", txtLName.Text)
>
Thanks,
>
Joe


"Chetan Chaphekar" <ChetanChaphekar@.discussions.microsoft.comwrote in
message news:F8362751-1E99-4F82-B043-D3D44F0A120F@.microsoft.com...

Quote:

Originally Posted by

it will definately work


As far as you are concerned, it will definitely work...

However, you need to think quite carefully about sending HTML emails...

Most modern mail software can be configured not only to strip out all HTML
content, but also to reject emails with HTML content...

Depending on how paranoid / security-conscious your recipients are, they
might never even see your emails if you send them in HTML format...
Hi Mark,

The problem is that I have some links in that HTM file. So I how can I
provide those links without any HTM code. Otherwise the user will need to
copy the URL into the Browser. Not that productive.

Regards,

Joe
"JoeP" <DF_XYZ@.hotmail.comwrote in message
news:OCnYUOPYHHA.3268@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

The problem is that I have some links in that HTM file. So I how can I
provide those links without any HTM code.


You can't...

Quote:

Originally Posted by

Otherwise the user will need to copy the URL into the Browser.


That's true.

Quote:

Originally Posted by

Not that productive.


Even less productive if the email gets rejected by the user's mail client
before the user even has a chance to see it...

Your call...
Hi Joep,

What mark has said is right but also consider the percentage of receipient
who has this kind of settings. almost all sites who send newsletter to the
subscriber use HTML code in their email.

cheers
chetan chaphekar

"JoeP" wrote:

Quote:

Originally Posted by

Hi Mark,
>
The problem is that I have some links in that HTM file. So I how can I
provide those links without any HTM code. Otherwise the user will need to
copy the URL into the Browser. Not that productive.
>
Regards,
>
Joe
>
>
>


"Chetan Chaphekar" <ChetanChaphekar@.discussions.microsoft.comwrote in
message news:85AB981F-934B-453F-A698-D79B7C5CF3B9@.microsoft.com...

Quote:

Originally Posted by

but also consider the percentage of receipient who has this kind of
settings.


Increasing all the time...

Quote:

Originally Posted by

almost all sites who send newsletter to the subscriber use HTML code in
their email.


More and more now give their recipients the option of receiving such
correspondence either in plain text or HTML...

pass through value of DropDownList ListItem into a string

Greetings.

I'm building an email form that uses a DropDownList to select the e-mail address via alias. Here is a portion of the control:

<asp:DropDownList id="ddlRecipient" CssClass="text-blue" AutoPostBack="true" runat="server">
<asp:ListItem Value="none" Selected="true">Please select from this list.</asp:ListItem>
<asp:ListItem Value="mornings">the morning show</asp:ListItem>
<asp:ListItem Value="news">News - newscasts, stories, comments</asp:ListItem>
</asp:DropDownList
Here is the code I am supposedly using to pass through the value:

Sub SendMe ()
Dim ddlRecipient As String
Dim ddlRecipientEmail As String = ddlRecipient & "@dotnet.itags.org.mydomain.com"
Response.Write(ddlRecipientEmail & " -- this is the email address you just sent")
End Sub

(The Response.Write line will be replaced by my email generation code, and I will use ddlRecipientEmail as the "from" field.)

However, all I get from the Response.Write is:
@dotnet.itags.org.mydomain.com -- this is the email address you just sent

So it's not passing through the value. How do I get it to do that?

Also, I'm going to do an If/Then/Else statement that, if "none" is the value, you get a popup and the program stops running. Anyone got a quick way to do that?

Appreciate the help.

ddlRecipient.SELECTEDVALUE


Curt_C:

ddlRecipient.SELECTEDVALUE

I actually just found that and it is working now.Thank you.

Pass value to function

Hello,
I have this function:
Sub Add_Menu_Item(ByVal Id As String, ByVal Text() As String)
And I am calling it this way:
Add_Menu_Item("home", {"contact","contacts"})
I get this error:
Compiler Error Message: BC30201: Expression expected.
Why?
Thanks,
Miguel
You have to use it like this:
Add_Menu_Item("home", new string() {"contact","contacts"})

Saturday, March 24, 2012

Pass Variable to another function

Hi,
I have a small question...Is there a way to do a postback to the same
page and pass a value to a function OnClick?

Example:

void GetCityName(string c)
{
string city = c;
}

Now I want to call this function by Doing a PostBack with a
asp:LinkButton.

So, here is the asp:LinkButton code.
<asp:LinkButton ID="mob" runat="server" Text="MOB"
OnClick="GetCityName('MOB')"></asp:LinkButton
Can this be done?

ThanksA Onclick serverside event must conform to the delegate signature of
the CommandEventHandler. You could store the value in a hidden html
input using javascript, then in your server event handler retrieve the
value by using Request.Form.GetValues.

Endo
Or store the value in a session variable.
i.e.
Session["city"] = city;

then have the event handler grab it
i.e.
city = (string)Session["city"];

<bcutting@.gmail.com> wrote in message
news:1129235285.953333.183460@.g44g2000cwa.googlegr oups.com...
> A Onclick serverside event must conform to the delegate signature of
> the CommandEventHandler. You could store the value in a hidden html
> input using javascript, then in your server event handler retrieve the
> value by using Request.Form.GetValues.
> Endo
I am total lost...
Does anyone have an example...

What I have is a map of Alabama. So now if I show Mobile, Montgomery on
the map...
and make each city as a LinkButton.

What I am doing is when the user clicks on (MOB) which is Mobile...I
have a query string that goes to a SQL Server and find data where the
city = 'mob'. I want to create a generic function that does this. So
everytime Ijust click a city all that I have to do is call the function
name and pass the city code.

Thanks

Pass Variable to another function

Hi,
I have a small question...Is there a way to do a postback to the same
page and pass a value to a function OnClick?
Example:
void GetCityName(string c)
{
string city = c;
}
Now I want to call this function by Doing a PostBack with a
asp:LinkButton.
So, here is the asp:LinkButton code.
<asp:LinkButton ID="mob" runat="server" Text="MOB"
OnClick="GetCityName('MOB')"></asp:LinkButton>
Can this be done?
ThanksA Onclick serverside event must conform to the delegate signature of
the CommandEventHandler. You could store the value in a hidden html
input using javascript, then in your server event handler retrieve the
value by using Request.Form.GetValues.
Endo
Or store the value in a session variable.
i.e.
Session["city"] = city;
then have the event handler grab it
i.e.
city = (string)Session["city"];
<bcutting@.gmail.com> wrote in message
news:1129235285.953333.183460@.g44g2000cwa.googlegroups.com...
> A Onclick serverside event must conform to the delegate signature of
> the CommandEventHandler. You could store the value in a hidden html
> input using javascript, then in your server event handler retrieve the
> value by using Request.Form.GetValues.
> Endo
>
I am total lost...
Does anyone have an example...
What I have is a map of Alabama. So now if I show Mobile, Montgomery on
the map...
and make each city as a LinkButton.
What I am doing is when the user clicks on (MOB) which is Mobile...I
have a query string that goes to a SQL Server and find data where the
city = 'mob'. I want to create a generic function that does this. So
everytime Ijust click a city all that I have to do is call the function
name and pass the city code.
Thanks

Pass variable to URL string

In ASP.NET, the HTML code, I have the following lines to pass variable MyType to the URL parameter:
<P><a id="aHome" runat="Server" class="nav"href="Main.aspx?HeaderType=<%= headertype%>">Home</a></P>
In my Main.aspx page, when I query the string as:Request.QueryString("HeaderType"), it always return me "<%=headertype %>", but not the value of variable: headertype.
How can I pass a variable value to URL string parameter.
Thanks.

You can use :

Response.Redirect("newPage.aspx?value="+TextBox1.Text);

Let me know if you need this to work when the hyperlink is clicked.

Hope this helps !


Thanksfor your answer, it works,
If you can tell me how to pass it to URL string, it will be very helpfull. Hyperlilnk does not have click event.

Pass Variable to URL string

I pass the variable in URL string as following:
<P><a id="aSupport" runat="Server" class="nav"href="Support.aspx?HeaderType=<%= headertype%>">Support</a></P>
When I query the string in Support.aspx, it always give me "<%= headertype %>", but not the value of the variable.
How Can I pass the value of the variable to URL string parameter.
Thanks.

Why not use an asp:hyperlink.

Then you can use the code-behind pages to set the link, etc.

Inline code is generally not the best choice.

Passing 2 variables through query string

Hi,

I know normally how to pass a value through a query string but this is complicated by wanting to pass two values. The first value is passed from a datagrid hyper link column i.e

<asp:HyperLinkColumn DataNavigateUrlField="PK_StockOrderID" DataNavigateUrlFormatString="AssignedDetail.aspx?id={0}"
DataTextField="PK_StockOrderID" HeaderText="Order ID"></asp:HyperLinkColumn>


This allows the user to view order details in the next page by passing the order id through the query string to the next page. However I also have a dropdown list box on the same page as the datagrid and would like to pass another parameter in the same query string based on the value selected in the list box.

Any ideas how I can do this?

If this doesnt make sense pls say and I will explain further.

Will something like this work if I have a function in my codebehind which returns the value of the dropdown list?
<asp:HyperLinkColumn DataNavigateUrlField="PK_StockOrderID" DataNavigateUrlFormatString="AssignedDetail.aspx?id={0} ?site=<%# ReturnSite %>"
DataTextField="PK_StockOrderID" HeaderText="Order ID"></asp:HyperLinkColumn>Normaly additional parameters in a querystring are separated by an ampersand (&)... not the ? (that's only on the first one to mark the begining of the QS.) and no spaces.

-tg
it's not calling the function at the moment I think this is the problem syntax

<asp:HyperLinkColumn DataNavigateUrlField="PK_StockOrderID" DataNavigateUrlFormatString="AssignedDetail.aspx?id={0}&site='<%# ReturnSite %>'"
Change of plan. Can I use the selected index changed property to set the DataNavigateUrlFormatString. That would be better but I cannot find the correct syntax?
Honestly, it's out of my realm of expertise... I've not had the chance to delve into ASP.NET, so I don't know for sure what the proper syntax is... I don't even know enough to point you in the right direction other than MSDN... Sorry...

-tg
Passed variable to a public class instead.
The ItemCommand event of the datagrid could have done this for you. Basically, you could retrieve the value from the Item that sent the Command (convert to DDL, get selected value) and then gotten the value from the standalone DDL in your page, concatenated them and then performed a Response.Redirect.

Passing a "where" claus to populate a datagrid on another form.

I have a form where a user can enter mulitple search criteria. Depending upon what they choose I begin stringing the information into a string field that I pass to another form.

It is my intention to open this form that contains a datagrid which returns the records that match their search criteria.

I have had success sending the information, but I am completely lost as to how I use this information.

I dragged the dbconnection, the dataadapter and created the dataset onto the form, but I am not sure if this is how I should have done it. Perhaps all of this should be done in code and create the select string in code for the dataadapter? Does anyone have code that they could share the accomplishes this?

Currently the form brings up all records, (before I started tinkering), but I do not know how to set the 'where' claus.

Thanks for your helpHere is some of the code I am working with:

Dim conn As New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\Access_ResourceDB\Access_ResourceDb_Backend\ResourceDb_be.mdb")

Dim ds As New DataSet("MyDataSet")

Dim objCmd As New OleDbDataAdapter("Select RecId,Name,Age,Town,HowmPhone,Email FROM tblContacts " & "Where " & pasRecCrit & ";", conn)

conn.Open()
objCmd.Fill(ds, "MyDataSet")
Me.DataGrid1.DataSource = ds.Tables("MyDataSet")
Me.DataGrid1.DataBind()

This is just one of the ways I have tried. Right now I get an error stating that
"No value given for one or more required parameters", on the objCmd.fill line.
Thanks
What do have in the pasRecCrit variable? This looks like it should work. Maybe your Where clause isn't formatted correctly.

Wednesday, March 21, 2012

Passing a object to a reflection class

Hello,

I would like to be able to pass an object from my code behind to another class and return a string with all the object properties and values.

IE Book has Book.Title= "The grinch" Book.Author="Tom Jones"

I need to be able to do something like

GetObjectsProperties(book) book is an instance of the class Book

This would returnTitle= "The grinch" Author="Tom Jones"

I undertand I can use System.Reflection for this, however I could not find a good example.


give this a try:

Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load'one of the page properties we're going to read requires us to validate first... Page.Validate()'just as a sample, we'll pass the current page object to inspect the properties Response.Write(GetProps(Me))End Sub Private Function GetProps(ByVal targetAs Object)As String Dim propInfoArray()As System.Reflection.PropertyInfoDim resultAs New System.Text.StringBuilder'get array of propertyinfo objects for our targets Type propInfoArray = target.GetType.GetProperties'iterate through these propertyinfo objectsFor Each propInfoAs System.Reflection.PropertyInfoIn propInfoArrayDim sAs String Try s = Convert.ToString(propInfo.GetValue(target,Nothing))Catch exAs Exception s ="Error reading property"End Try result.AppendFormat("{0}=""{1}"" ", propInfo.Name, s)Next Return result.ToStringEnd Function

Hey, thanks for your help.

When converting this to C# , one line of code did not work for me. Please advise.

using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NGB.Mobilization.Util;
using System.Reflection;

public partial class Mobilization_Default2 : NGB.GKO.WebUI.GKOPage
{
protected void Page_Load(object sender, EventArgs e)
{
userLinksControl.UserName = this.CurUser.UserName;

ArrayList excludeColumns = new ArrayList();
excludeColumns.Add("UserId");
Response.Write(GetProps(this.CurUser, excludeColumns));
}

private stringGetProps(Object target, ArrayList excludeColumns)
{
//PropertyInfo propInfoArray = new PropertyInfo();
StringBuilder result = new StringBuilder();
//get array of propertyinfo objects for our targets Type
PropertyInfo[] propInfoArray = target.GetType().GetProperties();
// iterate through these propertyinfo objects

foreach(PropertyInfo propInfo in propInfoArray)
{
// Do Not Add Excluded Columns
if (excludeColumns.Contains(propInfo.Name) == false)
{
string s;

try
{
s = propInfo.GetValue(propInfo, null).ToString();
// s = Convert.ToString(propInfo.GetValue(target, Nothing));
}
catch
{
// na
s = "Error reading property";
}
result.AppendFormat("<b>{0}</b> = {1} ", propInfo.Name, s);
}
}

return result.ToString();

}

This prints:

UserName = Error reading propertyFirstName = Error reading propertyLastName = Error reading propertyEmail = Error reading propertyState = Error reading propertyBranch = Error reading propertyDebug = Error reading property

Thanks for your helpmbanavige!



}

change it to this:

s = propInfo.GetValue(target, null).ToString();


awesome it worked. thanks man!

I'm going to make this a "helper" function for my project.

i'll post the code when it's complete

Passing a Querry string in a Response.Redirect?

I want to be able to redirect on a Button click event with a querry string attached with the username, is this possible?
would it look something like?
'Response.Redirect("link.aspx?UserId="Label.Text"") or
'Response.Redirect("link.aspx?userid=("Label.Text"))

This should do it:
Response.Redirect( "link.aspx?UserId=" & Server.UrlEncode(myLabel.Text) )

Passing a query string

I used Repeater control to bind data and I need something like

<a href="http://links.10026.com/?link=showsection.aspx?section=<%# DataBinder.Eval(Container.DataItem, "SectionId") %>"><%# DataBinder.Eval(Container.DataItem, "Name") %></a>

How can I pass what sectionId is selected on the showsection.aspx page? And oh, is this a good way of having something like a navigator? Or is there any other better way? Thanks.Didn't understand the second part of your question...
I solved it through
public void DisplaySections()
{
SectionCollection sectionCollection = SectionAccess.ListExcludeInactive();
Response.Write("<table width='100%' cellspacing='0'>");
foreach (Section section in sectionCollection)
{
Response.Write(string.Format(@."<tr><td class='navbar'><a href='showsection.aspx?section={0}'>{1}</a></td></tr>", section.SectionId, section.Name));
}
Response.Write("<tr><td class='navbar'> </td></tr></table>");
}

and get the section with
public void DisplayLatestWithSection()
{
int id = int.Parse(Request.QueryString["section"].ToString());
Article article = ArticleAccess.LatestWithSection(id);
if (article != null)
{
Response.Write(string.Format(@."<span class='teaser-head'><a href='showarticle.aspx?article={0}'>{1}</a></span><br>", article.ArticleId, article.HtmlTeaserHead));
Response.Write(article.HtmlTeaserDate + "<br>");
Response.Write(article.HtmlTeaserText);
}
}

at the showsection.aspx. Or is there any better way of getting the query string name and value?

passing a string array?

How can I send a string array to another aspx page?Don't you want to use session object?

"agb" <agbeltekin@.mynet.com> wrote in message
news:%23%23o4VPUbDHA.4020@.tk2msftngp13.phx.gbl...
> How can I send a string array to another aspx page?
Hello

There are several methods to do this, the best method depends on your
application.

1 - Put your array in a session variable. This method can be used with any
type of data

2 - Using cookies: concatenate the strings in one big string (use any
separator ';' for example ) then send it as a cookie to the brower, in the
other aspx page, get the cookie value, split the string to get the array.

3 - Same as method 2 but use a query string instead of cookies, for exampe
mypage.aspx?mystrings=str1;str2;str3;str4.

4 - Put strings in hidden form fields, and submit to your other page.

Best Regards

Sherif

"agb" <agbeltekin@.mynet.com> wrote in message
news:##o4VPUbDHA.4020@.tk2msftngp13.phx.gbl...
> How can I send a string array to another aspx page?
Thanks a lot

"Sherif ElMetainy" <elmeteny@.wayout.net> wrote in message
news:uHTBHFVbDHA.2264@.TK2MSFTNGP11.phx.gbl...
> Hello
> There are several methods to do this, the best method depends on your
> application.
> 1 - Put your array in a session variable. This method can be used with any
> type of data
> 2 - Using cookies: concatenate the strings in one big string (use any
> separator ';' for example ) then send it as a cookie to the brower, in the
> other aspx page, get the cookie value, split the string to get the array.
> 3 - Same as method 2 but use a query string instead of cookies, for exampe
> mypage.aspx?mystrings=str1;str2;str3;str4.
> 4 - Put strings in hidden form fields, and submit to your other page.
> Best Regards
> Sherif
> "agb" <agbeltekin@.mynet.com> wrote in message
> news:##o4VPUbDHA.4020@.tk2msftngp13.phx.gbl...
> > How can I send a string array to another aspx page?

Passing A String

Hello, I am a newbie. Thanks for all the great help I have recieved so far. Here is my latestest question.
I am trying to capture the referring site and the landing page url with query string on the initial entry page of my website. I am able to add these values to session, but they get overwritten each page I visit. My guess is that I need to write some sort of boolean test so these values are not added again if they already exist. Here is the code I have written.
Thanks for your help.
John

// Get query string

string urlreffer =Convert.ToString(Request.UrlReferrer);

string urlraw =Convert.ToString(Request.RawUrl);

string sessionid =Convert.ToString(Request.Cookies);

// add to session

Session.Add("reffer", urlreffer);

Session.Add("rawurl", urlraw);

Session.Add("sessionid", sessionid);

Hello,
In what event do you have this code, in the page_Load event? If so, surround the code with:
if (!page.IsPostBack) {
}
If another event, let me know.
HTH.

protectedvoid Page_Load(object sender,EventArgs e)

{

// Get query string

string urlrefer =Convert.ToString(Request.UrlReferrer);

string urlraw =Convert.ToString(Request.Url);

string sessionid =Convert.ToString(Request.Cookies["ASP.NET_SessionId"].Value);

// test to see if values are already in session.

if (Session["refer"] ==null ||Convert.ToString(Session["refer"]).Length == 0)

{

// add to session

Session.Add("refer", urlrefer);

Session.Add("rawurl", urlraw);

Session.Add("sessionid", sessionid);

}

}

}

passing a string from the server to client side javascript

Hello all,
I have an ASP.NET website where one of my pages contain javascript that is a
check to see if anydata within a datagrid has changed. My problem is that it
takes a considerable amount of time to populate the array in the javascript
after the datagrid is populated.
What I am thinking of doing is creating a comma delimited string on the
server side (.vb) and then have the javascript pick it up through array()...
.
My problem that I am trying to figure out is how do I pass a string that is
created in a server side function back to the client so that a javascript
function could read it and populate an array.
Does anybody have any pointers how to do this?
Thank you,
LynersPrepare the commans separated string and then write it in JS block using
RegisterclientScriptBlock kind of methods. And then have another JS function
implementted that picks up this string and populate what ever you are
populating.
"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
>
In your aspx file:
<%# MyString%>
In your VB-file:
Protected MyString as string = "m,y,s,t,r,i,n,g"
Hope this helps you
"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
>
Thanks Maarten, but my string keeps coming back empty. I had a simular setup
prior to your comment, I changed the Public string to a protected string, bu
t
still no dice.
Here is my declaration and my statement that is creating the string:
Protected strIds As String = "Start"
In my loop I do the following;
dblRecordCounter = dblRecordCounter + 1
strIds = strIds & "," & "MyDataGrid__ctl" + Str(dblRecordCounter
+ 2) + "_txtField"
In the aspx file I have this;
ServerString = new String('<%# strIds%>');
var ids = ServerString.split(',');
but ids[0] or 1,2,3,4,5... is blank
I know I am missing something simple. Can you see it?
Thank you,
Lyner
"Maarten" wrote:

> In your aspx file:
> <%# MyString%>
> In your VB-file:
> Protected MyString as string = "m,y,s,t,r,i,n,g"
> Hope this helps you
> "Lyners" <Lyners@.discussions.microsoft.com> wrote in message
> news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
>
>
You are not sending the string to the client.
In your client html
function Page_onLoad() {
var blnVisible = <%= m_strVisible %>;
I knew it was something like this, but another question, because I still
don't have it working. Does the javascript fire off the Page_onLoad()
everytime the page is loaded? Because I put an alert in the onLoad part and
it never fired, which leads me to think that in the body tag I need to put a
n
onLoad event to pick up the string.
Correct or not?
Thans alot!
"sirfunusa" wrote:

> You are not sending the string to the client.
> In your client html
> function Page_onLoad() {
> var blnVisible = <%= m_strVisible %>;
>
This is normally done with a hidden input control:
<input type=hidden runat=server id=inhMyParameter">
Eliyahu
"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
>
Incorrect. Perhaps you posted to the wrong question? He was asking how
to pass a string from server to client.
Why do you think is it incorrect?
Eliyahu
"sirfunusa" <sirfunusa@.hotmail.com> wrote in message
news:1144081480.686619.283100@.i39g2000cwa.googlegroups.com...
> Incorrect. Perhaps you posted to the wrong question? He was asking how
> to pass a string from server to client.
>
Not incorrect at all. Use of hidden field is another approach to do the same
thing.
"sirfunusa" <sirfunusa@.hotmail.com> wrote in message
news:1144081480.686619.283100@.i39g2000cwa.googlegroups.com...
> Incorrect. Perhaps you posted to the wrong question? He was asking how
> to pass a string from server to client.
>

passing a string from the server to client side javascript

Hello all,
I have an ASP.NET website where one of my pages contain javascript that is a
check to see if anydata within a datagrid has changed. My problem is that it
takes a considerable amount of time to populate the array in the javascript
after the datagrid is populated.

What I am thinking of doing is creating a comma delimited string on the
server side (.vb) and then have the javascript pick it up through array()...

My problem that I am trying to figure out is how do I pass a string that is
created in a server side function back to the client so that a javascript
function could read it and populate an array.

Does anybody have any pointers how to do this?

Thank you,
LynersPrepare the commans separated string and then write it in JS block using
RegisterclientScriptBlock kind of methods. And then have another JS function
implementted that picks up this string and populate what ever you are
populating.

"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
In your aspx file:

<%# MyString%
In your VB-file:
Protected MyString as string = "m,y,s,t,r,i,n,g"

Hope this helps you

"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
Thanks Maarten, but my string keeps coming back empty. I had a simular setup
prior to your comment, I changed the Public string to a protected string, but
still no dice.

Here is my declaration and my statement that is creating the string:

Protected strIds As String = "Start"

In my loop I do the following;

dblRecordCounter = dblRecordCounter + 1
strIds = strIds & "," & "MyDataGrid__ctl" + Str(dblRecordCounter
+ 2) + "_txtField"

In the aspx file I have this;
ServerString = new String('<%# strIds%>');
var ids = ServerString.split(',');

but ids[0] or 1,2,3,4,5... is blank

I know I am missing something simple. Can you see it?

Thank you,
Lyner
"Maarten" wrote:

> In your aspx file:
> <%# MyString%>
> In your VB-file:
> Protected MyString as string = "m,y,s,t,r,i,n,g"
> Hope this helps you
> "Lyners" <Lyners@.discussions.microsoft.com> wrote in message
> news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> > Hello all,
> > I have an ASP.NET website where one of my pages contain javascript that is
> > a
> > check to see if anydata within a datagrid has changed. My problem is that
> > it
> > takes a considerable amount of time to populate the array in the
> > javascript
> > after the datagrid is populated.
> > What I am thinking of doing is creating a comma delimited string on the
> > server side (.vb) and then have the javascript pick it up through
> > array()...
> > My problem that I am trying to figure out is how do I pass a string that
> > is
> > created in a server side function back to the client so that a javascript
> > function could read it and populate an array.
> > Does anybody have any pointers how to do this?
> > Thank you,
> > Lyners
>
You are not sending the string to the client.

In your client html

function Page_onLoad() {
var blnVisible = <%= m_strVisible %>;
I knew it was something like this, but another question, because I still
don't have it working. Does the javascript fire off the Page_onLoad()
everytime the page is loaded? Because I put an alert in the onLoad part and
it never fired, which leads me to think that in the body tag I need to put an
onLoad event to pick up the string.

Correct or not?

Thans alot!

"sirfunusa" wrote:

> You are not sending the string to the client.
> In your client html
> function Page_onLoad() {
> var blnVisible = <%= m_strVisible %>;
>
This is normally done with a hidden input control:

<input type=hidden runat=server id=inhMyParameter"
Eliyahu

"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:DF2717EF-9B7F-4CE7-B78E-973878F7092C@.microsoft.com...
> Hello all,
> I have an ASP.NET website where one of my pages contain javascript that is
> a
> check to see if anydata within a datagrid has changed. My problem is that
> it
> takes a considerable amount of time to populate the array in the
> javascript
> after the datagrid is populated.
> What I am thinking of doing is creating a comma delimited string on the
> server side (.vb) and then have the javascript pick it up through
> array()...
> My problem that I am trying to figure out is how do I pass a string that
> is
> created in a server side function back to the client so that a javascript
> function could read it and populate an array.
> Does anybody have any pointers how to do this?
> Thank you,
> Lyners
Incorrect. Perhaps you posted to the wrong question? He was asking how
to pass a string from server to client.
Why do you think is it incorrect?

Eliyahu

"sirfunusa" <sirfunusa@.hotmail.com> wrote in message
news:1144081480.686619.283100@.i39g2000cwa.googlegr oups.com...
> Incorrect. Perhaps you posted to the wrong question? He was asking how
> to pass a string from server to client.
Not incorrect at all. Use of hidden field is another approach to do the same
thing.

"sirfunusa" <sirfunusa@.hotmail.com> wrote in message
news:1144081480.686619.283100@.i39g2000cwa.googlegr oups.com...
> Incorrect. Perhaps you posted to the wrong question? He was asking how
> to pass a string from server to client.
You never set the value.