c# - Adding a redirect to a Web Control / HTML Writer -


i creating dynamic navigation, loop putting each record in database button. want add redirect buttons when clicked directs page passing id over. how can make buttons redirect??

the html writer tag button follows ::

writer.renderbegintag(tag.button); 

if use html button (i guess < input type='button'>), can interact them using javascript. should use

window.location = url 

and build url contain id :

http://mysite/mypage?id=12 

then may pass id using data attributes. example :

<input type='button' data-id="12"/> 

then, in js, if using jquery :

var btn = ...get-your-button-by-id-or-class-name-or-whatever var id = btn.data('id'); window.location='http://mysite/mypage?id='+id; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -