Redirection with Cell Phone Browsers

A

Andy

I have written an ASP.NET app that searches an XML database
for journal titles. The app passes two session variables
(title and means of search) from one page to another. I
only now got the session variables to work as intended.

The problem started when I press the Search command
control on my default.aspx page. The appropriate code
is here:

private void cmdSeek_Click(object sender, System.EventArgs e)
{
Utility Util = new Utility();
if (Util.IsValidSearchPhrase(this.txtSeek.Text))
{
string resultsURL;

Session["sought"] = (string) this.txtSeek.Text;
Session["sortby"] = (string) this.rdoSortby.Selection.Value;

resultsURL = this.ResolveUrl("results.aspx");
this.RedirectToMobilePage(resultsURL);
}
}

Now, the command control works as intended on browsers that access
the page via wired (IE, Netscape) or Wi-Fi (PocketIE, Palm/NetForce)
connections. The control does *not* work on cell phone browsers like
OpenWave or BlackBerry. I found out why on examining the ASP.NET
output to the OpenWave browser: ASP.NET is interpreting the URL
as going back to default.aspx!

<anchor title="Seek">Search
<go href="/ ... /Default.aspx">
<postfield name="__EVENTTARGET" value="cmdSeek" />
<postfield name="txtSeek" value="$(txtSeek)" />
<postfield name="rdoSortby" value="$(rdoSortby)" />
</go>
</anchor>

Is there any way to make ASP.NET interpreting the URL correctly?
 
D

Deepak

Andy,

I don't think your problem is the <go href..., because a asp.net web form
always posts to itself and your redirection is in the event handler of the
'Seek' command button. if your results.aspx is in the same folder as the
default.aspx try replacing

this.RedirectToMobilePage(resultsURL)

with

this.RedirectToMobilePage("results.aspx")

- Deepak
 
A

Andy

Thank you very much, Deepak.

Deepak said:
Andy,

I don't think your problem is the <go href..., because a asp.net web form
always posts to itself and your redirection is in the event handler of the
'Seek' command button. if your results.aspx is in the same folder as the
default.aspx try replacing

this.RedirectToMobilePage(resultsURL)

with

this.RedirectToMobilePage("results.aspx")

- Deepak
Andy said:
I have written an ASP.NET app that searches an XML database
for journal titles. The app passes two session variables
(title and means of search) from one page to another. I
only now got the session variables to work as intended.

The problem started when I press the Search command
control on my default.aspx page. The appropriate code
is here:

private void cmdSeek_Click(object sender, System.EventArgs e)
{
Utility Util = new Utility();
if (Util.IsValidSearchPhrase(this.txtSeek.Text))
{
string resultsURL;

Session["sought"] = (string) this.txtSeek.Text;
Session["sortby"] = (string) this.rdoSortby.Selection.Value;

resultsURL = this.ResolveUrl("results.aspx");
this.RedirectToMobilePage(resultsURL);
}
}

Now, the command control works as intended on browsers that access
the page via wired (IE, Netscape) or Wi-Fi (PocketIE, Palm/NetForce)
connections. The control does *not* work on cell phone browsers like
OpenWave or BlackBerry. I found out why on examining the ASP.NET
output to the OpenWave browser: ASP.NET is interpreting the URL
as going back to default.aspx!

<anchor title="Seek">Search
<go href="/ ... /Default.aspx">
<postfield name="__EVENTTARGET" value="cmdSeek" />
<postfield name="txtSeek" value="$(txtSeek)" />
<postfield name="rdoSortby" value="$(rdoSortby)" />
</go>
</anchor>

Is there any way to make ASP.NET interpreting the URL correctly?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top