|
Hello Fellows,
i am having a problem while trying to bind the dropdown list in gridview.
i am able to fill the dropdown. But my problem is that i am updating the gridview without postbacks.
i mean to say the update command is written in the sqldatasource.
Can any body tell me how can i bind the dropdownlist?
For textbox we use Bind("columnname").
any help is highly appreciated
Thanks in advance.
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="lbldomainstatus" runat="server" Font-Bold="True" Text="Status"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblStatus" runat="server" CssClass="blacktext" Text='<%# Eval("status")%>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="status" runat="server" width="100px" DataValueField="status" DataTextField="status" DataSource="<%#GetStatus() %>" CausesValidation="false" ></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
Ahsan Ullah
|
|
|
|
|
Hii,
I am working on a Web Application Asp.NET 1.1
I want to restrict multiple login at the same time in my web application. eg, If someone is logged in with Username 'mubashir', no one else wold be able to log in with username 'mubashir' till the first one is logged out.
How do I go about doing this?
thanks,
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
One way could be to have a boolean field in the database for the user and once the user is logged in you can make that field to true and check it with that when the user is trying to log for the next time.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanx,
But i need to reset that bool field when the user will log off. What if the user logs off in an abnormal way? Ho do I reset it then?
regards,
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
You can have a look at This[^]
Best Regards,
Apurva Kaushal
|
|
|
|
|
you can set all the user logged in the application variable means as a arraylist.
when somebody logout the session_end event fired.
you can trap a user & delete it from application arraylist.
Pankaj Gupta
(Take it easy)
|
|
|
|
|
But session_end event will not get fired in case is the session is being ended abnormally..
So not in all the case this will work.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have page for an online examination. i have retreived the questions and options from the database. to display the options ,i have created radiobuttonlist and assigned the options.
but i have to retrieve the selected options and store in the database.
how to retrieve the selected item from radiobuttonlist which created @runtime.
any ideas will be appreciated , thanks in advance
sebasian
|
|
|
|
|
When you are saving it you have to find the control first and then iterate it and then find which one is selected and store it somewhere and finally save it in the database.
Best Regards,
Apurva Kaushal
|
|
|
|
|
thank you very much. may i use the find control method; should i get any link that contains examples.
|
|
|
|
|
|
thank you it was very much helpful
|
|
|
|
|
Friends,
In my asp.net application i have to write function on textbox's onblur event. Can anyone please help me how to do this.
Eg:
I am having a textbox for email id. when user leave the textbox i have to get the part before @symbol in that. For that i have write event in textbox's onblur.
Thanks and Regards,
Prya
|
|
|
|
|
You can write a javascript function to do the task and call this function on onblur event of the textbox.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Can u pl. tellme how to give onblur event of textbox in .cs page
Prya
|
|
|
|
|
you can do it like this:
Textbox1.attributes.add(OnBlur,"Javascript:yourfunc();")
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have included master page in that aspx page. so there is a tag
<asp:content>. So shall i place the and tags above this and write the function there. But when I tried in some where its giving problem while adding head tags before content tag.
<div class="ForumSig">Prya</div>
|
|
|
|
|
I think you can put the function there in the head tag itself. What is the problem you are getting on doing the same.
Best Regards,
Apurva Kaushal
|
|
|
|
|
The Error I am getting is:
Content is not supported outside 'script' or 'asp:content' regions.
Prya
|
|
|
|
|
Try it by putting it inside the <asp:content> tag.
Best Regards,
Apurva Kaushal
|
|
|
|
|
you can add the javsscript function inside the <asp:content> tag.
call that javascript function with the help of .cs file.
Pankaj Gupta
(Take it easy)
|
|
|
|
|
Hi guys
I am stuck in one problem. I have table called folder. in that i am storing information of all folders that are made by users. i have one field in this table called parentfolderid. so by that i can store parent folder's id in my table so that i can have hierarchy of folders.
Now my problem is that there can be sub folders in the folder so by following code i get value upto second level but if there is hierarchy like
Root folder --> parent folder --> child folder --> grand child folder
Then it will not handle in my code so if any one can help me i would be very pleased.
--------CODE---------
Try
dr = temp.ExecuteDataReader("Select * from Folder where ID = ParentFolderID")
While dr.Read
Dim tNode As New TreeNode
tNode.Text = dr("Name")
Root = dr("ID")
Tree1.Nodes.Add(tNode)
Try
dr1 = dbaccess.ExecuteDataReader("Select * from Folder where ID <> ParentFolderID and ParentFolderID = '" & Root.ToString & "'")
While dr1.Read
Dim tChileNode1 As New TreeNode()
tChileNode1.Text = dr1("Name")
tNode.ChildNodes.Add(tChileNode1)
End While
Catch ex As Exception
Finally
dr1.Close()
End Try
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
dr.Close()
End Try
Please help me
|
|
|
|
|
|
|
Please read "How to get an answer to your question" in the top of the message board
Best Regards
3ala2
|
|
|
|