Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is Passing Parameters to an ASPX page like ASCX controls possible?

Reply
Thread Tools

Is Passing Parameters to an ASPX page like ASCX controls possible?

 
 
David Freeman
Guest
Posts: n/a
 
      11-07-2004
Hi There!

I'm just wondering if there's a way to pass parameters (as if you were
passing parameters to a ASCX web control) when calling an ASPX page?

e.g.
MyDetailsPage.UserName = "david"

OR... the only way to do it is to use the QueryString or Session object?

Thanks all in advance!!!

David


 
Reply With Quote
 
 
 
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      11-07-2004
David,
In your code-behind page, define a public property. Then, anywhere you
have context to your page, you can set this property. The most common,
easy, way, however is to use the querystring. I would recommend using that.

Of course, for the user, I would use Forms Authentication.

Best regards,
Jeffrey Palermo

"David Freeman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi There!
>
> I'm just wondering if there's a way to pass parameters (as if you were
> passing parameters to a ASCX web control) when calling an ASPX page?
>
> e.g.
> MyDetailsPage.UserName = "david"
>
> OR... the only way to do it is to use the QueryString or Session object?
>
> Thanks all in advance!!!
>
> David
>
>



 
Reply With Quote
 
 
 
 
David Freeman
Guest
Posts: n/a
 
      11-08-2004
Hi Jeff!

Thanks for the reply! But I'm not using code-behind model (because I don't
want to compile it while I'm developing). So this method can also be used in
the <script> block instead, right?

Another thing I want to clarify is that I want to pass parameters to
**another** ASPX page and not to the same ASPX page itself for postback. Can
this method be used for this?

For example, when I call "MyDetailsPage.aspx" from "home.aspx", I want to
pass parameters to "MyDetailsPage.aspx" like...

MyDetailsPage.UserName = "David"

Is this possible or am I hoping the impossible?

Thanks again!!

David

"Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote in
message news:(E-Mail Removed)...
> David,
> In your code-behind page, define a public property. Then, anywhere
> you
> have context to your page, you can set this property. The most common,
> easy, way, however is to use the querystring. I would recommend using
> that.
>
> Of course, for the user, I would use Forms Authentication.
>
> Best regards,
> Jeffrey Palermo
>
> "David Freeman" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi There!
>>
>> I'm just wondering if there's a way to pass parameters (as if you were
>> passing parameters to a ASCX web control) when calling an ASPX page?
>>
>> e.g.
>> MyDetailsPage.UserName = "david"
>>
>> OR... the only way to do it is to use the QueryString or Session object?
>>
>> Thanks all in advance!!!
>>
>> David
>>
>>

>
>



 
Reply With Quote
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      11-09-2004
David,
That's really not how HTTP posting works. In ASP.NET, data can be
passed to a page in several ways. Querystring, Form fields, and if you do a
Server.Transfer to the second page, then you can use the .Items collection.
I would recommend Request.Querystring or Request.Form.

So, yes, there is not way to call a second page and set a property on the
second page before doing the transfer.

Best regards,
Jeffrey Palermo

"David Freeman" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Jeff!
>
> Thanks for the reply! But I'm not using code-behind model (because I don't
> want to compile it while I'm developing). So this method can also be used

in
> the <script> block instead, right?
>
> Another thing I want to clarify is that I want to pass parameters to
> **another** ASPX page and not to the same ASPX page itself for postback.

Can
> this method be used for this?
>
> For example, when I call "MyDetailsPage.aspx" from "home.aspx", I want to
> pass parameters to "MyDetailsPage.aspx" like...
>
> MyDetailsPage.UserName = "David"
>
> Is this possible or am I hoping the impossible?
>
> Thanks again!!
>
> David
>
> "Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote

in
> message news:(E-Mail Removed)...
> > David,
> > In your code-behind page, define a public property. Then, anywhere
> > you
> > have context to your page, you can set this property. The most common,
> > easy, way, however is to use the querystring. I would recommend using
> > that.
> >
> > Of course, for the user, I would use Forms Authentication.
> >
> > Best regards,
> > Jeffrey Palermo
> >
> > "David Freeman" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Hi There!
> >>
> >> I'm just wondering if there's a way to pass parameters (as if you were
> >> passing parameters to a ASCX web control) when calling an ASPX page?
> >>
> >> e.g.
> >> MyDetailsPage.UserName = "david"
> >>
> >> OR... the only way to do it is to use the QueryString or Session

object?
> >>
> >> Thanks all in advance!!!
> >>
> >> David
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
David Freeman
Guest
Posts: n/a
 
      11-09-2004
Thanks Jeff.

David

"Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote in
message news:(E-Mail Removed)...
> David,
> That's really not how HTTP posting works. In ASP.NET, data can be
> passed to a page in several ways. Querystring, Form fields, and if you do
> a
> Server.Transfer to the second page, then you can use the .Items
> collection.
> I would recommend Request.Querystring or Request.Form.
>
> So, yes, there is not way to call a second page and set a property on the
> second page before doing the transfer.
>
> Best regards,
> Jeffrey Palermo
>
> "David Freeman" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi Jeff!
>>
>> Thanks for the reply! But I'm not using code-behind model (because I
>> don't
>> want to compile it while I'm developing). So this method can also be used

> in
>> the <script> block instead, right?
>>
>> Another thing I want to clarify is that I want to pass parameters to
>> **another** ASPX page and not to the same ASPX page itself for postback.

> Can
>> this method be used for this?
>>
>> For example, when I call "MyDetailsPage.aspx" from "home.aspx", I want to
>> pass parameters to "MyDetailsPage.aspx" like...
>>
>> MyDetailsPage.UserName = "David"
>>
>> Is this possible or am I hoping the impossible?
>>
>> Thanks again!!
>>
>> David
>>
>> "Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote

> in
>> message news:(E-Mail Removed)...
>> > David,
>> > In your code-behind page, define a public property. Then, anywhere
>> > you
>> > have context to your page, you can set this property. The most common,
>> > easy, way, however is to use the querystring. I would recommend using
>> > that.
>> >
>> > Of course, for the user, I would use Forms Authentication.
>> >
>> > Best regards,
>> > Jeffrey Palermo
>> >
>> > "David Freeman" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> Hi There!
>> >>
>> >> I'm just wondering if there's a way to pass parameters (as if you were
>> >> passing parameters to a ASCX web control) when calling an ASPX page?
>> >>
>> >> e.g.
>> >> MyDetailsPage.UserName = "david"
>> >>
>> >> OR... the only way to do it is to use the QueryString or Session

> object?
>> >>
>> >> Thanks all in advance!!!
>> >>
>> >> David
>> >>
>> >>
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables from ASPX page to ASCX control Fernando Chilvarguer ASP .Net 5 09-01-2006 01:16 AM
i'd like to include aspx page to aspx page uto ASP .Net 3 03-08-2006 03:56 PM
Making Objects from Custom HttpModule Available to ASPX Page or ASCX Controls? Mike Kline ASP .Net 1 01-07-2005 11:31 PM
Is Passing Parameters to an ASPX page like ASCX controls possible? David Freeman ASP .Net Web Controls 4 11-09-2004 05:51 AM
passing variables from aspx page to ascx control darrel ASP .Net 2 05-21-2004 03:55 PM



Advertisments