Posted By

housecor on 09/08/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Get the question number from the end of the calling control's ID


 / Published in: C#
 

Useful when you have multiple fields on a page that call the same method (ie via OnSelectedIndexChanged), since you can't pass a param as part of the call

  1. int QuestionNumber = Convert.ToInt16(rbList.ID.ToString().Substring(rbList.ID.ToString().Length -1, 1)); //get the question number from the end of the control's ID.

Report this snippet  

You need to login to post a comment.