开发者

Forcing postback on selection of a radio button

开发者 https://www.devze.com 2023-01-03 03:11 出处:网络
I know this is simple开发者_高级运维 as cake but I\'ve been using ASP.NET controls for way too long.I assume you have to do this via javascript with a regular XHTML input tag?To redirect to a URL afte

I know this is simple开发者_高级运维 as cake but I've been using ASP.NET controls for way too long. I assume you have to do this via javascript with a regular XHTML input tag?


To redirect to a URL after selecting a radio button:

<input type="radio" name="myRadio" onclick="window.location.href='/my/desired/url.aspx';" />


You can simply call a javascript method that sets window.location

function redirect() {
  window.location = 'http://whatever...'
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号