How to take textbox,labeland chckbox controls as per user demad

Posted by t5j9033387989 under ASP.NET on 12/13/2013 | Points: 10 | Views : 1677 | Status : [Member] | Replies : 4
I want to implement like this,

If i have 5 users of my application then i want 5 textbox,5 labels and 10 checkboxes,
means i want user control as per demand but here no of users is not fixed,
actually it is come from database,

Then how i implemet like this.
any suggestion.?

mark this answer if it will really help you,

Thanks&Regards
ketan



Responses

Posted by: vishalneeraj-24503 on: 12/13/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
In global.asax file,take Session variable, in session_start event, write
If users are going to log-in,then you can increase no of count as user logged-in count

Session["users_count"]+=1;

And in your page,

check session values,depend upon count,you can create controls you want.

refer also :
http://www.mindfiresolutions.com/How-to-Show-Session-Count-in-ASPNet-Web-Application-227.php


t5j9033387989, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 12/13/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Also refer:-
http://stackoverflow.com/questions/20534254/issue-with-global-asax-giving-arraylist-to-all-new-sessions-in-asp-net

t5j9033387989, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: t5j9033387989 on: 12/16/2013 [Member] Starter | Points: 25

Up
0
Down
is it possible with Repeater control if yes then how..?can anyone suggest me.?

mark this answer if it will really help you,

Thanks&Regards
ketan

t5j9033387989, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: t5j9033387989 on: 12/18/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks ,for your valuable reply ,but i'm still confuse


in my .aspx file i put this code,

<asp:Repeater id="rptcontrol"

runat="server">

<ItemTemplate>
<tr>
<td><asp:RadioButton ID="radiomale" runat="server" Text="Male" class="form-control" /></td>
<td> <asp:RadioButton ID="radiofemale" runat="server" Text="Female" class="form-control"/></td>
<td> <asp:TextBox ID="txtfirstname" runat="server" class="form-control" ></asp:TextBox></td>
<td> <asp:TextBox ID="txtlastname" runat="server" class="form-control" ></asp:TextBox></td>
<td> <asp:TextBox ID="txtmail" runat="server" class="form-control" ></asp:TextBox></td>
</tr>
</ItemTemplate>
</asp:Repeater>

and in .cs file

  var r = (from a in db.EMR_INVITATIONs
where a.EventID == (int)Session["eventid"]


select new
{
No_Of_Extra_Invitee=a.No_Extra_Invitee
}).First();


but now i don't want to bind data,i only want control,as if i got value of var r's if 2 then i want 4 checkbox and 6 textbox,any suggestion for that.

Thanks in advance.

mark this answer if it will really help you,

Thanks&Regards
ketan

t5j9033387989, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response