Skip to main content
Inspiring
May 17, 2006
Question

Response.Redirect / ASP.NET

  • May 17, 2006
  • 7 replies
  • 2214 views
Guys
How can I pass a variable taken from a database field
eg:

<% Response.Redirect ("success.aspx?login_ID=a value taken from the dataset
field in a binding") %>

everything i've tried just results in an error!

regards
AndyG


This topic has been closed for replies.

7 replies

Inspiring
May 21, 2006
Just meant to clarify that they are not neccessarily "useless" Kevin.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Kevin Marshall" <kev@no-spam.webxel.com> wrote in message
news:e4na6r$gd8$1@forums.macromedia.com...
> Hi Clinton,
>
> I can honestly say that the only time I use the <% %> notation is within
> the page body accompanied with # or = to output dynamic values or call
> methods.
>
> <%# expression %>
> <%# MyMethod(MyParameter) %>
> <%= expression %>
> <%= MyMethod(MyParameter) %>
>
> I have yet to find myself in a situation where using <% %> for any other
> reason would be beneficial over server side script blocks and event
> procedures.
>
>
> --
> Kevin Marshall
> WebXeL.com Ltd
> http://www.webxel.com
>
> ASP.NET Dreamweaver Extensions
> http://www.webxel-dw.co.uk
>
> "clintonG" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message
> news:e4j7ks$chk$1@forums.macromedia.com...
>> I'd have to defer to your insight of Dreamweaver datasets but your
>> comments about "code blocks" being completely useless are misleading.
>>
>> Actually the use of <% %> expression handlers (code blocks) continue to
>> be useful for those that do learn more about the page event model.
>> Furthermore there are new expression handlers [1] introduced with ASP.NET
>> 2.0.
>>
>> <%= Clinton Gallagher
>> NET csgallagher AT metromilwaukee.com
>> URL http://www.metromilwaukee.com/clintongallagher/
>>
>> [1] http://msdn2.microsoft.com/en-US/library/d5bd1tad.aspx
>>
>>
>>
>> "Kevin Marshall" <kev@no-spam.webxel.com> wrote in message
>> news:e4j3ni$8c8$1@forums.macromedia.com...
>>> any code within <% %> is going to be interpreted before the dataset has
>>> any data loaded into it.
>>>
>>> Dreamweaver datasets are implemented as usercontrols and fetch datafrom
>>> the database during the Page_Load phase, so your code will never work.
>>>
>>> Stick a Page_Load in the page and place your Response.Redirect there,
>>> that should work.
>>>
>>> Using <% %> for server side code is the old ASP way of doing things,
>>> unfortunately ASP.NET still allows this even though its completely
>>> useless, always place your code within <script runat="server"> tags, and
>>> learn about the lifecycle of an ASP.NET page, its all event driven these
>>> days.
>>>
>>>
>>> --
>>> Kevin Marshall
>>> WebXeL.com Ltd
>>> http://www.webxel.com
>>>
>>> ASP.NET Dreamweaver Extensions
>>> http://www.webxel-dw.co.uk
>>>
>>> "somewhere nowhere" <somewhere@nowhere.com> wrote in message
>>> news:e4e988$og4$1@forums.macromedia.com...
>>>> Guys
>>>> How can I pass a variable taken from a database field
>>>> eg:
>>>>
>>>> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
>>>> dataset field in a binding") %>
>>>>
>>>> everything i've tried just results in an error!
>>>>
>>>> regards
>>>> AndyG
>>>>
>>>
>>>
>>
>>
>
>


Inspiring
May 20, 2006
Hi Clinton,

I can honestly say that the only time I use the <% %> notation is within the
page body accompanied with # or = to output dynamic values or call methods.

<%# expression %>
<%# MyMethod(MyParameter) %>
<%= expression %>
<%= MyMethod(MyParameter) %>

I have yet to find myself in a situation where using <% %> for any other
reason would be beneficial over server side script blocks and event
procedures.


--
Kevin Marshall
WebXeL.com Ltd
http://www.webxel.com

ASP.NET Dreamweaver Extensions
http://www.webxel-dw.co.uk

"clintonG" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:e4j7ks$chk$1@forums.macromedia.com...
> I'd have to defer to your insight of Dreamweaver datasets but your
> comments about "code blocks" being completely useless are misleading.
>
> Actually the use of <% %> expression handlers (code blocks) continue to be
> useful for those that do learn more about the page event model.
> Furthermore there are new expression handlers [1] introduced with ASP.NET
> 2.0.
>
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URL http://www.metromilwaukee.com/clintongallagher/
>
> [1] http://msdn2.microsoft.com/en-US/library/d5bd1tad.aspx
>
>
>
> "Kevin Marshall" <kev@no-spam.webxel.com> wrote in message
> news:e4j3ni$8c8$1@forums.macromedia.com...
>> any code within <% %> is going to be interpreted before the dataset has
>> any data loaded into it.
>>
>> Dreamweaver datasets are implemented as usercontrols and fetch datafrom
>> the database during the Page_Load phase, so your code will never work.
>>
>> Stick a Page_Load in the page and place your Response.Redirect there,
>> that should work.
>>
>> Using <% %> for server side code is the old ASP way of doing things,
>> unfortunately ASP.NET still allows this even though its completely
>> useless, always place your code within <script runat="server"> tags, and
>> learn about the lifecycle of an ASP.NET page, its all event driven these
>> days.
>>
>>
>> --
>> Kevin Marshall
>> WebXeL.com Ltd
>> http://www.webxel.com
>>
>> ASP.NET Dreamweaver Extensions
>> http://www.webxel-dw.co.uk
>>
>> "somewhere nowhere" <somewhere@nowhere.com> wrote in message
>> news:e4e988$og4$1@forums.macromedia.com...
>>> Guys
>>> How can I pass a variable taken from a database field
>>> eg:
>>>
>>> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
>>> dataset field in a binding") %>
>>>
>>> everything i've tried just results in an error!
>>>
>>> regards
>>> AndyG
>>>
>>
>>
>
>


Inspiring
May 19, 2006
I'd have to defer to your insight of Dreamweaver datasets but your comments
about "code blocks" being completely useless are misleading.

Actually the use of <% %> expression handlers (code blocks) continue to be
useful for those that do learn more about the page event model. Furthermore
there are new expression handlers [1] introduced with ASP.NET 2.0.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

[1] http://msdn2.microsoft.com/en-US/library/d5bd1tad.aspx



"Kevin Marshall" <kev@no-spam.webxel.com> wrote in message
news:e4j3ni$8c8$1@forums.macromedia.com...
> any code within <% %> is going to be interpreted before the dataset has
> any data loaded into it.
>
> Dreamweaver datasets are implemented as usercontrols and fetch datafrom
> the database during the Page_Load phase, so your code will never work.
>
> Stick a Page_Load in the page and place your Response.Redirect there, that
> should work.
>
> Using <% %> for server side code is the old ASP way of doing things,
> unfortunately ASP.NET still allows this even though its completely
> useless, always place your code within <script runat="server"> tags, and
> learn about the lifecycle of an ASP.NET page, its all event driven these
> days.
>
>
> --
> Kevin Marshall
> WebXeL.com Ltd
> http://www.webxel.com
>
> ASP.NET Dreamweaver Extensions
> http://www.webxel-dw.co.uk
>
> "somewhere nowhere" <somewhere@nowhere.com> wrote in message
> news:e4e988$og4$1@forums.macromedia.com...
>> Guys
>> How can I pass a variable taken from a database field
>> eg:
>>
>> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
>> dataset field in a binding") %>
>>
>> everything i've tried just results in an error!
>>
>> regards
>> AndyG
>>
>
>


Inspiring
May 19, 2006
any code within <% %> is going to be interpreted before the dataset has any
data loaded into it.

Dreamweaver datasets are implemented as usercontrols and fetch datafrom the
database during the Page_Load phase, so your code will never work.

Stick a Page_Load in the page and place your Response.Redirect there, that
should work.

Using <% %> for server side code is the old ASP way of doing things,
unfortunately ASP.NET still allows this even though its completely useless,
always place your code within <script runat="server"> tags, and learn about
the lifecycle of an ASP.NET page, its all event driven these days.


--
Kevin Marshall
WebXeL.com Ltd
http://www.webxel.com

ASP.NET Dreamweaver Extensions
http://www.webxel-dw.co.uk

"somewhere nowhere" <somewhere@nowhere.com> wrote in message
news:e4e988$og4$1@forums.macromedia.com...
> Guys
> How can I pass a variable taken from a database field
> eg:
>
> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
> dataset field in a binding") %>
>
> everything i've tried just results in an error!
>
> regards
> AndyG
>


Inspiring
May 17, 2006
Try assigning the value to a variable...

string redirect = "success.aspx?login_ID=...";
Response.Redirect(redirect);

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/


"somewhere nowhere" <somewhere@nowhere.com> wrote in message
news:e4g9ef$g7j$1@forums.macromedia.com...
>a standard DW dataset paul...
> id hope that a simple drag and drop of the binding would have worked but
> no joy..
> somehow I need to get the value of dataset ID number into the
> response.redirect value!
> if you can help great
> regards
> Andy
>
> "Paul Whitham ACE" <design@valleybiz.net> wrote in message
> news:e4g62f$ci3$1@forums.macromedia.com...
>> Andy
>>
>> Is this coming from a DW dataset or one you have written yourself.
>>
>> --
>> Paul Whitham
>> Certified Dreamweaver MX2004 Professional
>> Adobe Community Expert - Dreamweaver
>>
>> Valleybiz Internet Design
>> www.valleybiz.net
>>
>> "somewhere nowhere" <somewhere@nowhere.com> wrote in message
>> news:e4e988$og4$1@forums.macromedia.com...
>>> Guys
>>> How can I pass a variable taken from a database field
>>> eg:
>>>
>>> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
>>> dataset field in a binding") %>
>>>
>>> everything i've tried just results in an error!
>>>
>>> regards
>>> AndyG
>>>
>>
>>
>
>


Inspiring
May 17, 2006
a standard DW dataset paul...
id hope that a simple drag and drop of the binding would have worked but no
joy..
somehow I need to get the value of dataset ID number into the
response.redirect value!
if you can help great
regards
Andy

"Paul Whitham ACE" <design@valleybiz.net> wrote in message
news:e4g62f$ci3$1@forums.macromedia.com...
> Andy
>
> Is this coming from a DW dataset or one you have written yourself.
>
> --
> Paul Whitham
> Certified Dreamweaver MX2004 Professional
> Adobe Community Expert - Dreamweaver
>
> Valleybiz Internet Design
> www.valleybiz.net
>
> "somewhere nowhere" <somewhere@nowhere.com> wrote in message
> news:e4e988$og4$1@forums.macromedia.com...
>> Guys
>> How can I pass a variable taken from a database field
>> eg:
>>
>> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
>> dataset field in a binding") %>
>>
>> everything i've tried just results in an error!
>>
>> regards
>> AndyG
>>
>
>


Inspiring
May 17, 2006
Andy

Is this coming from a DW dataset or one you have written yourself.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"somewhere nowhere" <somewhere@nowhere.com> wrote in message
news:e4e988$og4$1@forums.macromedia.com...
> Guys
> How can I pass a variable taken from a database field
> eg:
>
> <% Response.Redirect ("success.aspx?login_ID=a value taken from the
> dataset field in a binding") %>
>
> everything i've tried just results in an error!
>
> regards
> AndyG
>