From: Gregory A. Beamer on
"Hemant" <Hemant(a)nomail.com> wrote in news:OOTi2nQPKHA.2092
@TK2MSFTNGP04.phx.gbl:

> Hi,
> I am working on a web application in vb.net 2005.
> I want to get a ID of Item in Application_BeginRequest function of
> global.asax file .
> I can't use query string.
> Is there any method ?
> I want to pass a ID to that function from a .aspx page .
> Please help me.

i am not sure I understand the issue.

In code behind, you can get the session id at any time. You can then
feed it to a function and get back whatever answer you need. Why must
you do it in Application_BeginRequest (which is prior to parsing out the
information from the client, if I remember correctly)?

The big question is WHAT are you trying to solve, not HOW are you trying
to solve it now.

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
From: Hemant on
Hi ,
Thanks for your replies.
I am doing url rewriting .
In Application_BeginRequest i want to get ID's of the string.
At this function I call the Context.Rewrite Path to Redirect the correct
page
What I need that I want to store that ID some where so that I can pass that
ID to the Right page.
For Example :
My URL is www.Test.com/book-asp.html
But the actual URL for this is www.Test.com/Product.aspx?ID = 100
I want to get this ID at that function so that I can call the correct page
with correct ID.
Thanks,
Hemant

"Gregory A. Beamer" <NoSpamMgbworld(a)comcast.netNoSpamM> wrote in message
news:Xns9C905FC80FAE5gbworld(a)207.46.248.16...
> "Hemant" <Hemant(a)nomail.com> wrote in news:OOTi2nQPKHA.2092
> @TK2MSFTNGP04.phx.gbl:
>
>> Hi,
>> I am working on a web application in vb.net 2005.
>> I want to get a ID of Item in Application_BeginRequest function of
>> global.asax file .
>> I can't use query string.
>> Is there any method ?
>> I want to pass a ID to that function from a .aspx page .
>> Please help me.
>
> i am not sure I understand the issue.
>
> In code behind, you can get the session id at any time. You can then
> feed it to a function and get back whatever answer you need. Why must
> you do it in Application_BeginRequest (which is prior to parsing out the
> information from the client, if I remember correctly)?
>
> The big question is WHAT are you trying to solve, not HOW are you trying
> to solve it now.
>
> Peace and Grace,
>
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> Twitter: @gbworld
> Blog: http://gregorybeamer.spaces.live.com
>
> My vacation and childhood cancer awareness site:
> http://www.crazycancertour.com
>
> *******************************************
> | Think outside the box! |
> *******************************************


From: Alexey Smirnov on
On Sep 25, 6:45 am, "Hemant" <Hem...(a)nomail.com> wrote:
> Hi ,
> Thanks for your replies.
> I am doing url rewriting .
> In Application_BeginRequest i want to get ID's of the string.
> At this function I call the Context.Rewrite Path to Redirect the correct
> page
> What I need that I want to store that ID  some where so that I can pass that
> ID to the Right page.
> For Example :
> My URL iswww.Test.com/book-asp.html
> But the actual URL for this iswww.Test.com/Product.aspx?ID= 100
> I want to get this ID at that function so that I can call the correct page
> with correct ID.
> Thanks,
> Hemant

Let's see what we have

> My URL iswww.Test.com/book-asp.html

ok

> But the actual URL for this iswww.Test.com/Product.aspx?ID= 100

ok

Now, going back to your question - what do we have in
Application_BeginRequest? We have "book-asp.html", we don't need any
querystring here because this is a new location we have to redirect
to. Am I right?
From: Hemant on
Hi,
Yes you are right.

know at Application_BeginRequest I redirect .
I want to get that ID so that I can pass this to that page.
Thanks.
Hemant .
"Alexey Smirnov" <alexey.smirnov(a)gmail.com> wrote in message
news:055762a5-34a2-470f-a9f0-f1fbc184dd81(a)l34g2000vba.googlegroups.com...
On Sep 25, 6:45 am, "Hemant" <Hem...(a)nomail.com> wrote:
> Hi ,
> Thanks for your replies.
> I am doing url rewriting .
> In Application_BeginRequest i want to get ID's of the string.
> At this function I call the Context.Rewrite Path to Redirect the correct
> page
> What I need that I want to store that ID some where so that I can pass
> that
> ID to the Right page.
> For Example :
> My URL iswww.Test.com/book-asp.html
> But the actual URL for this iswww.Test.com/Product.aspx?ID= 100
> I want to get this ID at that function so that I can call the correct page
> with correct ID.
> Thanks,
> Hemant

Let's see what we have

> My URL iswww.Test.com/book-asp.html

ok

> But the actual URL for this iswww.Test.com/Product.aspx?ID= 100

ok

Now, going back to your question - what do we have in
Application_BeginRequest? We have "book-asp.html", we don't need any
querystring here because this is a new location we have to redirect
to. Am I right?


From: Alexey Smirnov on
Hemant, I don't think you understand the problem. All what you need is
to have something like this

void Application_BeginRequest(object sender, EventArgs e)
{
string url = Context.Request.Url.AbsolutePath;

if (url.Equals("/book-asp.html"))
Context.RewritePath("/Product.aspx?ID=100", false);
}

where you don't need any query string because the requested url is
book-asp.html and not Product.aspx?ID=100.

Hope this helps



On Sep 25, 9:37 am, "Hemant" <Hem...(a)nomail.com> wrote:
> Hi,
> Yes you are right.
>
> know at Application_BeginRequest I redirect .
>  I want to get that ID so that I can pass this to that page.
> Thanks.
> Hemant ."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>
> news:055762a5-34a2-470f-a9f0-f1fbc184dd81(a)l34g2000vba.googlegroups.com...
> On Sep 25, 6:45 am, "Hemant" <Hem...(a)nomail.com> wrote:
>
>
>
>
>
> > Hi ,
> > Thanks for your replies.
> > I am doing url rewriting .
> > In Application_BeginRequest i want to get ID's of the string.
> > At this function I call the Context.Rewrite Path to Redirect the correct
> > page
> > What I need that I want to store that ID some where so that I can pass
> > that
> > ID to the Right page.
> > For Example :
> > My URL iswww.Test.com/book-asp.html
> > But the actual URL for this iswww.Test.com/Product.aspx?ID=100
> > I want to get this ID at that function so that I can call the correct page
> > with correct ID.
> > Thanks,
> > Hemant
>
> Let's see what we have
>
> > My URL iswww.Test.com/book-asp.html
>
> ok
>
> > But the actual URL for this iswww.Test.com/Product.aspx?ID=100
>
> ok
>
> Now, going back to your question - what do we have in
> Application_BeginRequest? We have "book-asp.html", we don't need any
> querystring here because this is a new location we have to redirect
> to. Am I right?- Hide quoted text -
>
> - Show quoted text -