Showing posts with label level. Show all posts
Showing posts with label level. Show all posts

Monday, March 26, 2012

Newbie: Page level caching in ASP.NET

Hi,
How could Page level caching be implemented in ASP.NET ? My ASP.NET page
takes some query arguments and I want page level cache to last for the
lifetime of the page generated using the passed arguments only. If different
arguments are passed, I want new page level cache for the new page. Is it as
simple as adding page level variables ? Note page may query data
asynchronously using AJAX also. Does it change things ?
Thanks and regards
NavinAjax shouldn't screw around with anything.
To cache different versions based on querystring values, use the VaryByParam
attribute of the OutputCache control
<%@. OutputCache Duration="3600" VaryByParam="id" %>
assuming "id" is the querystring you want to create a different cache on.
Take a look at:
http://samples.gotdotnet.com/quicks...putcaching.aspx
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:uQ6LgmEAGHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How could Page level caching be implemented in ASP.NET ? My ASP.NET page
> takes some query arguments and I want page level cache to last for the
> lifetime of the page generated using the passed arguments only. If
> different
> arguments are passed, I want new page level cache for the new page. Is it
> as
> simple as adding page level variables ? Note page may query data
> asynchronously using AJAX also. Does it change things ?
> Thanks and regards
> Navin
>
Thanks. My qyery string is long passing a bunch of arguments. Would it work
for a combination of query string arguments ? Is there a limit ? I also
wanted simple caching while generated page is active and, to use the cache,
when an action is performed on the page. When page is destroyed, I want to
clear THAT page level cache. Would simple page level variables do that are
garbage collected when Page object is destroyed after ASP.NET page request
completes ?
Thanks again and regards
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uwpW89EAGHA.1256@.TK2MSFTNGP15.phx.gbl...
> Ajax shouldn't screw around with anything.
> To cache different versions based on querystring values, use the
VaryByParam
> attribute of the OutputCache control
> <%@. OutputCache Duration="3600" VaryByParam="id" %>
> assuming "id" is the querystring you want to create a different cache on.
> Take a look at:
> http://samples.gotdotnet.com/quicks...putcaching.aspx
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Navin Mishra" <navin.mishra@.siemens.com> wrote in message
> news:uQ6LgmEAGHA.916@.TK2MSFTNGP10.phx.gbl...
page
it
>
Comments appreciated! Is it possible ?
Thanks in advance and regards
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:%231jq8DLAGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Thanks. My qyery string is long passing a bunch of arguments. Would it
work
> for a combination of query string arguments ? Is there a limit ? I also
> wanted simple caching while generated page is active and, to use the
cache,
> when an action is performed on the page. When page is destroyed, I want to
> clear THAT page level cache. Would simple page level variables do that are
> garbage collected when Page object is destroyed after ASP.NET page request
> completes ?
> Thanks again and regards
> "Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
> wrote in message news:uwpW89EAGHA.1256@.TK2MSFTNGP15.phx.gbl...
> VaryByParam
on.
> page
> it
>

newbie: Problems creating asp.net 2.0 Menu

Hey

ASP.NET 2.0

On my web page I got 2 menu controls: menu A is a horizontal menu displaying
menuitems at the top level. Menu B displays the submenuitems related to what
is selected in menu A. Menu A and Menu B are using the same sitemap
provider.. This works fine today.

But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I also
want it show some other submenuitems which isn't affect by what is selected
in menu A

Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F

In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...

Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>

This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />

I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A

Best Regards

JeffLook at the bottom

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hey
>
ASP.NET 2.0
>
On my web page I got 2 menu controls: menu A is a horizontal menu
displaying menuitems at the top level. Menu B displays the submenuitems
related to what is selected in menu A. Menu A and Menu B are using the
same sitemap provider.. This works fine today.
>
But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I
also want it show some other submenuitems which isn't affect by what is
selected in menu A
>
Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F
>
In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...
>
Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
>
This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />
>
I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A
>
Best Regards
>
Jeff
>


the menu markup I posted in my previous post is NOT for menu B it is for
menu A

Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>

I still wondering how to solve this

Jeff
I've solved this by using 2 menu controls

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>


I didn't find a solution so I had to use a workaround. Using 2 menu controls
instead of only 1

So I consider this thread for solved

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>

Thursday, March 22, 2012

Newby level question: Radio Buttons

Hello,

I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the possibility of multiple selections. However, one item is "None of the above" and I have placed some logic (autopostback, etc.) that will remove all previous selections if "None of the above" is chosen. My problem is this:

This list of Radio Buttons is at the bottom of the web page and with AutoPostback enabled (and someone selects one of these Radio Buttons) the web browser refreshes the screen and shows the top of the page. What can I do such that the screen refreshes and displays the bottom portion with the Radio Buttons? Or is there a way to do what I want to do without using AutoPostback?

TIA...Ferret Face,

You could try out setting the page's Smart Navigation property to true. Smart navigation keeps the screen position during post backs. But it doesn't work for any browser (that I know of) except IE and it can cause flaky behaviour.

Because of this I created a javascript that will automatically scroll a page to whatever control you specify as a reusable object. Actually the javascript object contains many useful scripts.

You can download the Javascript component I built for free with full source code as a VS2003 project from my website, www.aboutfortunate.com. Also download the .chm help file. It gives help for every control I've created all of which are downloadable from my site for free with full source.

To get the javascript component click the "Code Library" link at the top of my page and then click the "Javacript" button on the left.

You'll want to use the "ScrollToElement" method of the component.

If you have any questions about the component or use thereof feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Ferret Face" <ferretface@.msn.com> wrote in message news:LvidnWJEMaeBDr3eRVn-tw@.giganews.com...
Hello,

I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the possibility of multiple selections. However, one item is "None of the above" and I have placed some logic (autopostback, etc.) that will remove all previous selections if "None of the above" is chosen. My problem is this:

This list of Radio Buttons is at the bottom of the web page and with AutoPostback enabled (and someone selects one of these Radio Buttons) the web browser refreshes the screen and shows the top of the page. What can I do such that the screen refreshes and displays the bottom portion with the Radio Buttons? Or is there a way to do what I want to do without using AutoPostback?

TIA...
One solution is to enable SmartNavigation, although there are a lot of
reasons not to do so
(http://weblogs.asp.net/ksamaschke/a...04/27/6085.aspx,
http://weblogs.asp.net/dreilly/arch.../14/229424.aspx

Alternatively, you might want to take a look at the free (but no source
code) Smart Scroller:
http://www.strengthtechnologies.com/scroll/

Finally, you can likely achieve all that you want in JavaScript if that's
acceptable. Here's a quick example, might not work but should give you an
idea...

<div id="choices">
<input type="Radio" name="1" value="choice1">
<input type="Radio" name="2" value="choice2">
<input type="Radio" name="3" value="choice3">
<input type="Radio" name="4" value="choice4">
<input type="Radio" name="5" value="none" onClick="Clicked('choices',
this);">
</div
<script language="JavaScript">
function Clicked(containerName, source)
{
var container = document.getElementById(containerName);
if (!container){
//something went wrong
return;
}
var inputs = container.getElementsByTagName("INPUT");
for (var i = 0; i < inputs.length; ++i)
{
var input = inputs[i];
//if we have a radiobutton (we don't want to disable a textbox in here
too, or do we?) AND we aren't on the "none" button
if (input.type.toUpperCase() == "RADIO" && input.value != "none")
{
input.disabled = source.checked; //if our non button is checked, the
input is disabled, if it isn't checked, it's enabled.
}
}
}
</script>
--
MY ASP.Net tutorials
http://www.openmymind.net/

"Ferret Face" <ferretface@.msn.com> wrote in message
news:LvidnWJEMaeBDr3eRVn-tw@.giganews.com...
Hello,

I have a web page that gets the user to select items from a list of
options. This list is a set of independant Radio Buttons. I did not use a
Radio Button List because I wanted the possibility of multiple selections.
However, one item is "None of the above" and I have placed some logic
(autopostback, etc.) that will remove all previous selections if "None of
the above" is chosen. My problem is this:

This list of Radio Buttons is at the bottom of the web page and with
AutoPostback enabled (and someone selects one of these Radio Buttons) the
web browser refreshes the screen and shows the top of the page. What can I
do such that the screen refreshes and displays the bottom portion with the
Radio Buttons? Or is there a way to do what I want to do without using
AutoPostback?

TIA...
Hey! Who you callin' Ferret Face?!
... Wait, that's my name.

That JavaScript did the trick. I had to brush-up on JavaScript a bit to
do it. I ended up changing the line

if (input.type.toUpperCase() == "RADIO" && input.value != source.value)

to make it work.

Thanks!

"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23bJ5xBLtFHA.4080@.TK2MSFTNGP12.phx.gbl...
> One solution is to enable SmartNavigation, although there are a lot of
> reasons not to do so
> (http://weblogs.asp.net/ksamaschke/a...04/27/6085.aspx,
> http://weblogs.asp.net/dreilly/arch.../14/229424.aspx
> Alternatively, you might want to take a look at the free (but no source
> code) Smart Scroller:
> http://www.strengthtechnologies.com/scroll/
> Finally, you can likely achieve all that you want in JavaScript if that's
> acceptable. Here's a quick example, might not work but should give you an
> idea...
> <div id="choices">
> <input type="Radio" name="1" value="choice1">
> <input type="Radio" name="2" value="choice2">
> <input type="Radio" name="3" value="choice3">
> <input type="Radio" name="4" value="choice4">
> <input type="Radio" name="5" value="none" onClick="Clicked('choices',
> this);">
> </div>
> <script language="JavaScript">
> function Clicked(containerName, source)
> {
> var container = document.getElementById(containerName);
> if (!container){
> //something went wrong
> return;
> }
> var inputs = container.getElementsByTagName("INPUT");
> for (var i = 0; i < inputs.length; ++i)
> {
> var input = inputs[i];
> //if we have a radiobutton (we don't want to disable a textbox in here
> too, or do we?) AND we aren't on the "none" button
> if (input.type.toUpperCase() == "RADIO" && input.value != "none")
> {
> input.disabled = source.checked; //if our non button is checked, the
> input is disabled, if it isn't checked, it's enabled.
> }
> }
> }
> </script>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
> "Ferret Face" <ferretface@.msn.com> wrote in message
> news:LvidnWJEMaeBDr3eRVn-tw@.giganews.com...
> Hello,
> I have a web page that gets the user to select items from a list of
> options. This list is a set of independant Radio Buttons. I did not use
a
> Radio Button List because I wanted the possibility of multiple selections.
> However, one item is "None of the above" and I have placed some logic
> (autopostback, etc.) that will remove all previous selections if "None of
> the above" is chosen. My problem is this:
> This list of Radio Buttons is at the bottom of the web page and with
> AutoPostback enabled (and someone selects one of these Radio Buttons) the
> web browser refreshes the screen and shows the top of the page. What can
I
> do such that the screen refreshes and displays the bottom portion with the
> Radio Buttons? Or is there a way to do what I want to do without using
> AutoPostback?
> TIA...

Newby level question: Radio Buttons

Hello,
I have a web page that gets the user to select items from a list of options.
This list is a set of independant Radio Buttons. I did not use a Radio Bu
tton List because I wanted the possibility of multiple selections. However,
one item is "None of the above" and I have placed some logic (autopostback,
etc.) that will remove all previous selections if "None of the above" is ch
osen. My problem is this:
This list of Radio Buttons is at the bottom of the web page and with AutoPos
tback enabled (and someone selects one of these Radio Buttons) the web brows
er refreshes the screen and shows the top of the page. What can I do such t
hat the screen refreshes and displays the bottom portion with the Radio Butt
ons? Or is there a way to do what I want to do without using AutoPostback?
TIA...Ferret Face,
You could try out setting the page's Smart Navigation property to true. Smar
t navigation keeps the screen position during post backs. But it doesn't wor
k for any browser (that I know of) except IE and it can cause flaky behaviou
r.
Because of this I created a javascript that will automatically scroll a page
to whatever control you specify as a reusable object. Actually the javascri
pt object contains many useful scripts.
You can download the Javascript component I built for free with full source code as a V
S2003 project from my website, www.aboutfortunate.com. Also download the .ch
m help file. It gives help for every control I've created all of which are d
ownloadable from my site for free with full source.
To get the javascript component click the "Code Library" link at the top of
my page and then click the "Javacript" button on the left.
You'll want to use the "ScrollToElement" method of the component.
If you have any questions about the component or use thereof feel free to em
ail me.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Ferret Face" <ferretface@.msn.com> wrote in message news:LvidnWJEMaeBDr3eRVn
-tw@.giganews.com...
Hello,
I have a web page that gets the user to select items from a list of options.
This list is a set of independant Radio Buttons. I did not use a Radio Bu
tton List because I wanted the possibility of multiple selections. However,
one item is "None of the above" and I have placed some logic (autopostback,
etc.) that will remove all previous selections if "None of the above" is ch
osen. My problem is this:
This list of Radio Buttons is at the bottom of the web page and with AutoPos
tback enabled (and someone selects one of these Radio Buttons) the web brows
er refreshes the screen and shows the top of the page. What can I do such t
hat the screen refreshes and displays the bottom portion with the Radio Butt
ons? Or is there a way to do what I want to do without using AutoPostback?
TIA...
One solution is to enable SmartNavigation, although there are a lot of
reasons not to do so
(http://weblogs.asp.net/ksamaschke/a...4/27/6085.aspx,
http://weblogs.asp.net/dreilly/arch.../14/229424.aspx
Alternatively, you might want to take a look at the free (but no source
code) Smart Scroller:
http://www.strengthtechnologies.com/scroll/
Finally, you can likely achieve all that you want in JavaScript if that's
acceptable. Here's a quick example, might not work but should give you an
idea...
<div id="choices">
<input type="Radio" name="1" value="choice1">
<input type="Radio" name="2" value="choice2">
<input type="Radio" name="3" value="choice3">
<input type="Radio" name="4" value="choice4">
<input type="Radio" name="5" value="none" onClick="Clicked('choices',
this);">
</div>
<script language="JavaScript">
function Clicked(containerName, source)
{
var container = document.getElementById(containerName);
if (!container){
//something went wrong
return;
}
var inputs = container.getElementsByTagName("INPUT");
for (var i = 0; i < inputs.length; ++i)
{
var input = inputs[i];
//if we have a radiobutton (we don't want to disable a textbox in here
too, or do we?) AND we aren't on the "none" button
if (input.type.toUpperCase() == "RADIO" && input.value != "none")
{
input.disabled = source.checked; //if our non button is checked, the
input is disabled, if it isn't checked, it's enabled.
}
}
}
</script>
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Ferret Face" <ferretface@.msn.com> wrote in message
news:LvidnWJEMaeBDr3eRVn-tw@.giganews.com...
Hello,
I have a web page that gets the user to select items from a list of
options. This list is a set of independant Radio Buttons. I did not use a
Radio Button List because I wanted the possibility of multiple selections.
However, one item is "None of the above" and I have placed some logic
(autopostback, etc.) that will remove all previous selections if "None of
the above" is chosen. My problem is this:
This list of Radio Buttons is at the bottom of the web page and with
AutoPostback enabled (and someone selects one of these Radio Buttons) the
web browser refreshes the screen and shows the top of the page. What can I
do such that the screen refreshes and displays the bottom portion with the
Radio Buttons? Or is there a way to do what I want to do without using
AutoPostback?
TIA...
Hey! Who you callin' Ferret Face?!
... Wait, that's my name.
That JavaScript did the trick. I had to brush-up on JavaScript a bit to
do it. I ended up changing the line
if (input.type.toUpperCase() == "RADIO" && input.value != source.value)
to make it work.
Thanks!
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23bJ5xBLtFHA.4080@.TK2MSFTNGP12.phx.gbl...
> One solution is to enable SmartNavigation, although there are a lot of
> reasons not to do so
> (http://weblogs.asp.net/ksamaschke/a...4/27/6085.aspx,
> http://weblogs.asp.net/dreilly/arch.../14/229424.aspx
> Alternatively, you might want to take a look at the free (but no source
> code) Smart Scroller:
> http://www.strengthtechnologies.com/scroll/
> Finally, you can likely achieve all that you want in JavaScript if that's
> acceptable. Here's a quick example, might not work but should give you an
> idea...
> <div id="choices">
> <input type="Radio" name="1" value="choice1">
> <input type="Radio" name="2" value="choice2">
> <input type="Radio" name="3" value="choice3">
> <input type="Radio" name="4" value="choice4">
> <input type="Radio" name="5" value="none" onClick="Clicked('choices',
> this);">
> </div>
> <script language="JavaScript">
> function Clicked(containerName, source)
> {
> var container = document.getElementById(containerName);
> if (!container){
> //something went wrong
> return;
> }
> var inputs = container.getElementsByTagName("INPUT");
> for (var i = 0; i < inputs.length; ++i)
> {
> var input = inputs[i];
> //if we have a radiobutton (we don't want to disable a textbox in here
> too, or do we?) AND we aren't on the "none" button
> if (input.type.toUpperCase() == "RADIO" && input.value != "none")
> {
> input.disabled = source.checked; //if our non button is checked, the
> input is disabled, if it isn't checked, it's enabled.
> }
> }
> }
> </script>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
> "Ferret Face" <ferretface@.msn.com> wrote in message
> news:LvidnWJEMaeBDr3eRVn-tw@.giganews.com...
> Hello,
> I have a web page that gets the user to select items from a list of
> options. This list is a set of independant Radio Buttons. I did not use
a
> Radio Button List because I wanted the possibility of multiple selections.
> However, one item is "None of the above" and I have placed some logic
> (autopostback, etc.) that will remove all previous selections if "None of
> the above" is chosen. My problem is this:
> This list of Radio Buttons is at the bottom of the web page and with
> AutoPostback enabled (and someone selects one of these Radio Buttons) the
> web browser refreshes the screen and shows the top of the page. What can
I
> do such that the screen refreshes and displays the bottom portion with the
> Radio Buttons? Or is there a way to do what I want to do without using
> AutoPostback?
> TIA...
>