Thursday, March 29, 2012

Passing Values

Hi

I have two aspx pages in a frame and in the top page[top frame] i am
creating the controls[TextBox etc..] dynamically and putting in a place
holder. I have a hyperlink in this page[top frame] to populate the data in
the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
need to populate the bottom aspx page[bottom aspx page]based on the user
imputs. So i need to pass the values from the top aspx page [top frame] to
bottom aspx page[bottom frame]. how can i achieve this. Please give some
ideas...

Thanks in AdvanceSince these are just aspx pages, you should be able to the querystring, or
session variables to pass data between the 2 pages.
"Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have two aspx pages in a frame and in the top page[top frame] i am
> creating the controls[TextBox etc..] dynamically and putting in a place
> holder. I have a hyperlink in this page[top frame] to populate the data in
> the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
> need to populate the bottom aspx page[bottom aspx page]based on the user
> imputs. So i need to pass the values from the top aspx page [top frame] to
> bottom aspx page[bottom frame]. how can i achieve this. Please give some
> ideas...
>
> Thanks in Advance
I am using the hyperlink only to redirect the page. more if i am doing a
postback these text box values are not visible.I am getting an error 'Object
reference not set to an instance of an object'. So i am not able to set the
session also.

"Showjumper" <shojumper@.grkjashdjkf.com> wrote in message
news:uHw0LsD5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> Since these are just aspx pages, you should be able to the querystring, or
> session variables to pass data between the 2 pages.
> "Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
> news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> > Hi
> > I have two aspx pages in a frame and in the top page[top frame] i am
> > creating the controls[TextBox etc..] dynamically and putting in a place
> > holder. I have a hyperlink in this page[top frame] to populate the data
in
> > the bottom aspx page[bottom frame]. When the user clicks this hyperlink
i
> > need to populate the bottom aspx page[bottom aspx page]based on the
user
> > imputs. So i need to pass the values from the top aspx page [top frame]
to
> > bottom aspx page[bottom frame]. how can i achieve this. Please give some
> > ideas...
> > Thanks in Advance
> I am using the hyperlink only to redirect the page. more if i am doing a
> postback these text box values are not visible.I am getting an error
'Object
> reference not set to an instance of an object'. So i am not able to set
the
> session also.

The error probably means that you ar using a tag like <asp:Textbox
id="txtPipo"> in your aspx file but you do not declare a matching Textbox
object in your codebehind file like

Textbox txtPipo;

As for passing information, you can append all the data as name-value pairs
to the target url you pass to the redirect statement like

http:/someservername?name=pipo%20%address=woonwagen%20%o ccupation=clown

and then retrieve them through Request.QueryString as Showjumper already
suggested.

> "Showjumper" <shojumper@.grkjashdjkf.com> wrote in message
> news:uHw0LsD5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> > Since these are just aspx pages, you should be able to the querystring,
or
> > session variables to pass data between the 2 pages.
> > "Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
> > news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> > > Hi
> > > > I have two aspx pages in a frame and in the top page[top frame] i am
> > > creating the controls[TextBox etc..] dynamically and putting in a
place
> > > holder. I have a hyperlink in this page[top frame] to populate the
data
> > > in the bottom aspx page[bottom frame]. When the user clicks this
> > > hyperlink i need to populate the bottom aspx page[bottom aspx page]
> > > based on the user imputs. So i need to pass the values from the top
> > > aspx page [top frame] to bottom aspx page[bottom frame]. how can
> > > i achieve this. Please give some ideas...
You can pass some values via client side code to a control (or hidden
control) in your other frame.
Here's some javascript code that might do the trick for you:
parent.FRAMENAME.document.form1.myhiddentextbox.va lue='test';

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have two aspx pages in a frame and in the top page[top frame] i am
> creating the controls[TextBox etc..] dynamically and putting in a place
> holder. I have a hyperlink in this page[top frame] to populate the data in
> the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
> need to populate the bottom aspx page[bottom aspx page]based on the user
> imputs. So i need to pass the values from the top aspx page [top frame] to
> bottom aspx page[bottom frame]. how can i achieve this. Please give some
> ideas...
>
> Thanks in Advance

0 comments:

Post a Comment