|
Do you set the ID field in the DataKeyNames property of the DetailsView control?
|
|
|
|
|
That worked. Thanks. Eh, you wouldn't know how to keep it working even if I set the ID field readonly ?
|
|
|
|
|
Another option is that you can create the handler for the Deleting event of the ObjectDataSource control, in the handler you can set the Id or whatever property of the BO object stored in the e.InputParameters collection, this object is then passed to the Delete method as the parameter.
|
|
|
|
|
Hi Developers
I have been looking for Free AJAX enableb controls or Framework for ASP.net, but I dnt get any kool one. Most of these are commercial and very difficult to use.
Please let me know if you know about any simple+free AJAX enabled control for .NEt.
Note: I am using VB.net with ASP.net 1.1
Thanks in advance!
Lets work it Out.........!
-- modified at 10:37 Thursday 22nd June, 2006
|
|
|
|
|
!..Web Guru..! wrote: Most of these are commercial and very difficult to use.
hmmmm.....not a very good thing for a !..Web Guru..! to say...
You'll probably find that they're all pretty complex - in order to appeal to as wide an audience as possible, they must contain as many features as possible - meaning that they complicate quickly and tend to have fairly steep learning curves....
AJAX isn't difficult - why not try creating your own controls and components derived from the standard ones?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I have created a table on my page dynamically and in each cell I want to create a hyperlink that is invisible to the user but one 'clicked' will allow me to program the event in my code behind page which is vb.net? I cannot access the html code of the hyperlink as it is created on the fly.
From what I understand does the hyperlink not have an onclick event that can be responded to?
I am trying to mimic an excel spreadsheet with my table and want the user to click in a cell and have the background change to black to make the cell look selected.
I have this: (this is just part of it)
MyTable.Rows(i + 1).Cells(k + 1).BackColor = System.Drawing.Color.Black
Dim strHello As String
strHello = "Edit"
Dim e_link As HyperLink = New HyperLink
MyTable.Rows(i + 1).Cells(k + 1).Controls.Add(e_link)
If IsPostBack Then
MyTable.Rows(i + 1).Cells(k + 1).HorizontalAlign = HorizontalAlign.Center
e_link.ForeColor() = System.Drawing.Color.Black
e_link.Text = strHello
AddHandler e_link.Click, AddressOf e_link_Click
with this event handler placed lower
Private Sub e_link_Click(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("You clicked Me!")
End Sub
Thanks
|
|
|
|
|
It would probably be simpler to achieve this using client side scripting. The problem will be that a) no OnClick event, and b) even if you do manage to catch SOMETHING, it'll need a postback to update the cell colour.
If you were to do it on the client side, you can assign an onclick handler to each element, then use a simple style.background='#xxxxxx' kinda thing to change the cell's background color.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I want to test the condition of whether or not the cell was clicked in and if it is presently a white background then change it to black to signify that it was selected.
How can I write that in vb.net? If the buttonlink does not yet exist untilt he page loads how can I access it from client script? Sorry if I appear stupid - I just may be. . . . . but hopefully just new to it all.
I have this so far:
If e_link.OnClick = True Then
if (e_link.ForeColor() = System.Drawing.Color.Black)then
e_link.ForeColor() = System.Drawing.Color.White
End If
End if
I have an error on this line: e_link.OnClick can you test this at all?
Thx, tammy
|
|
|
|
|
|
Ok I have switched out my hyperlink for a linkbutton as such:
Dim e_link As LinkButton = New LinkButton
MyTable.Rows(i + 1).Cells(k + 1).Controls.Add(e_link)
Now how do I actually test if the button was clicked? I am not sure how to handle events in vb.net as much as c#.
I have this line:
AddHandler e_link.Click, AddressOf e_link_Click
With this sub below:
Private Sub e_link_Click(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("You clicked Me!")
End Sub
How to I actually call the event based on whether the link is clicked? Sorry if this sounds very simple - I am new to all of this.
I want to check that the cell(linkbutton) was clicked and if so perform my event.
Something like :
if e_link.click = true then . . . . .
|
|
|
|
|
Well, what you're doing with the event handler sounds good to me. I'm also a C# programmer starting to dabble in VB, so I'm not 100% sure. All I would suggest you add is a CommandName and CommandArgument . That way, when you get the handler method, you can pull out the CommandArgument which will have whatever pertinent information you wanted to be attached to that link. For instance, you could be the index of the cell in there.
Logifusion[^]
|
|
|
|
|
As far as I can tell there's no click event associated to the Hyperlink webcontrol. There is a ServerClick event for the HtmlAnchor control however, that will qualify for what you're trying to do.
Personally I'd try to work with the Attributes collection of the HyperLink or the Style collection of the table cell.
Hope this helps,
Patt
|
|
|
|
|
Hi,
In a DataGrid I have placed a comandField select button. This field sometimes shows a text value and should sometimes show the select button instead (Depending on the business rule).
How can I make the select button to appear?
I basically want to put the code where the question mark is to show the button instead of the text.
i.e.
in grid_RowDataBound event
If (e.Row.RowType = DataControlRowType.DataRow) Then
If Not (e.Row.DataItem("c_start_date").ToString() Is Nothing) Then
e.Row.Cells(9).Text = e.Row.DataItem("c_clinic_code").ToString() 'Change ur text here
Else
'show the accept(select) button as there is no start date...
??????????????????????
End If
End If
Thanks
|
|
|
|
|
You can do it in the simple way that using the Label and Button controls in the TemplateField of the GridView control. Depending on the c_start_date field value, you can display the text using the Label control and set the button invisible, otherwise make the label hidden using the Visible property. You can either set the Visible property in the RowDataBound event handler or use the data binding expression. In addition, you can also add dynamic button in this case.
|
|
|
|
|
please send me one example about show image in datagrid with source code or download file
regard
maryam
|
|
|
|
|
Hi,
Try this :
<asp:templatecolumn sortexpression="Name" headertext="Name">
<headerstyle forecolor="Black" font-bold="True">
<itemstyle width="200px">
<itemtemplate>
<asp:linkbutton runat="server" cssclass="GridItemLink" commandname="Select" text="<%# DataBinder.Eval ( Container.DataItem, "Name" ) %>">
This tag "" give u image in ur Datagrid.
Hope this helped u.Thanks and Regards.
|
|
|
|
|
<asp:TemplateColumn SortExpression="Name" HeaderText="Name"><br />
<HeaderStyle ForeColor="Black" Font-Bold="True"></HeaderStyle><br />
<ItemStyle Width="200px"></ItemStyle><br />
<ItemTemplate><br />
<img src="../Images/User01.gif"><br />
<asp:LinkButton runat="server" CssClass="GridItemLink" CommandName="Select" Text='<%# DataBinder.Eval ( Container.DataItem, "Name" ) %>' /><br />
</ItemTemplate><br />
</asp:TemplateColumn>
|
|
|
|
|
<asp:templatecolumn sortexpression="Name" headertext="Name">
<headerstyle forecolor="Black" font-bold="True">
<itemstyle width="200px">
<itemtemplate>
<asp:linkbutton runat="server" cssclass="GridItemLink" commandname="Select" text="<%# DataBinder.Eval ( Container.DataItem, "Name" ) %>">
I hope U can see the code now.
|
|
|
|
|
Just use templete column I guess u will get it
|
|
|
|
|
<b>I have developed the bottom code for the login </b>
Now i want to add the following implementations to this code
1. Prompting the user to change the password on first login
2. Password Resetting
3. Password Retrieval(Self service password Management)
4. Timely Expiry and updating the password
5. Restricting Multiple Logins by the same user for different Applications
6. Registration Request by the user
7. Automatic Logout of the user on closing of the browser
8. Menu to the user(Login, Logout etc)
9. Help for the User
10. Audit of each login with time stamp will be maintained
11. Session Idle time out
Can anybody help meee plzzzzzzzzzzzz..... it's urgent ?
<code>private void btnLogin_Click(object sender, System.EventArgs e)
{
dsUserdata =new DataSet();
dsUserdata = ssoWebService.ValidateUser(txtUserID.Text,txtPassword.Text);
//Declare a datatable and get the data into datatable
DataTable dtUserdata = new DataTable();
Session["count"]=1;
if (dtUserdata.Rows.Count>=1)
{
//redirect to HomePage;
dtUserdata= dsUserdata.Tables[0];
Session["LoginId"]= dtUserdata.Rows[0].ItemArray[0].ToString();
Session["LoginName"]=dtUserdata.Rows[0].ItemArray[1].ToString() ;
Session["UserId"]=dtUserdata.Rows[0].ItemArray[2].ToString();
Session["ApplicationId"]=dtUserdata.Rows[0].ItemArray[0].ToString();
Session["LoggedIn"]= true;
Response.Redirect("homepage.aspx");
}
else
if (Convert.ToInt16(Session["count"])>3)
{
// lock the status in the database
if (lockaccount()==1)
Response.Write("your Account has been blocked...Contact Adminstrator");
}
else
{
Session["count"]=Convert.ToInt32( Session["count"])+ 1;
Response.Write("Login Failed, Please check your details and Try again ");
}
}
private int lockaccount()
{
try
{
Connection = new SqlConnection(ConfigurationSettings.AppSettings.Get("ConnectionString"));
Command = new SqlCommand("update User_Application set LockedYN = 0 where LoginName= @loginname" ,Connection );
Command.Parameters.Add("@loginname",SqlDbType.VarChar,25).Value = txtUserID.Text;
Connection.Open();
return Command.ExecuteNonQuery();
}
catch(SqlException ex)
{
throw ex;
}
finally
{
Connection.Close();
}</code>
|
|
|
|
|
Can you use VS2005? A lot of what you are asking is already built in.
|
|
|
|
|
I don't get the VS 2005 Version. atleast can u tell me how to implement the get the count of wrong credentials that user entered. I already wrote code for locking and other things...it's urgent plzzz help me out...........
|
|
|
|
|
I want to try the same,
but I need some help from point 5, 7 to 11
Could you help me out please!
Thanks
Alwin
|
|
|
|
|
Hi all,
I have a ViewState DataTable which is bind with DataGrid.In DataGrid I have 2 columns they are Edit and Delete (and both are linkButton).
DataTable has 4 columns.
My Problem is that when i click on the Edit LinkButton it lanuches new Dialog window(this I have done) and on return of that window I need to update the DataTable with the corresponding row(this is what I am not getting).
I hope I have explained my self well.
Anyone please help me for this.
Thanks in advance.
|
|
|
|
|
Hello Everyone,
I'm Munjal from India. I know how to manage a session with the help of 'Session' in ASP.Net but how can we manage a session for a particular user logged in with the help of 'Cookie Authentication'. Can u send me the code
Munjal
|
|
|
|