|
How i can add click event on dynamically created ImageButton
|
|
|
|
|
try this
btn.Click += new EventHandler(sub_Click);
We are not a Code Charity
|
|
|
|
|
C#:
ImageButton button = new ImageButton();
button.Click += new ImageClickEventHandler(button_Click);
VB:
ImageButton button = new ImageButton
AddHandler button.Click, AddressOf button_Click
|
|
|
|
|
C#
<br />
button.Click += new EventHandler(Button_Click);<br />
vb
<br />
AddHandler buttonn.Click, AddressOf Button_Click<br />
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
I want to zoom that image when i click the Image Button..
Where I write that code ?.
|
|
|
|
|
check this out
http://www.codeproject.com/KB/web-image/ASPImaging1.aspx
We are not a Code Charity
|
|
|
|
|
Masood Kochi,SSF wrote: click event
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Hello,
I have a treeview with checkboxes and I want to get the Text of each checked
item into GridView or something with javascript. I don't want to postback.
Thanks
|
|
|
|
|
I think it would make more sense to use c#.
Why do you want to use javascript?
Is the treeview written in javascript?
You should try searching the net as well before you post asking for code.
We are not a Code Charity
|
|
|
|
|
the TreeView I used isn't whit javascipt.
and I said the reason that why i want to use javascript in first post. can see it?
I DON'T want to postback my page !
I search it before.
tanx
|
|
|
|
|
OK but the way you are going about this seems strange.
a user can turn javascript off in their browser.
check this article out:
http://www.codeproject.com/KB/webforms/ClientSideTreeView.aspx
We are not a Code Charity
|
|
|
|
|
Hello,
Can anybody suggest any other name for SLA.
A service level agreement is a group's ( or a department's ) commitment to attain specified performance levels. It’s a quantifiable measure of a group's productivity and efficiency.
We are having a intranet web tool and there is a requirement to update the name of the SLA tool to something else. Any guesses?
Thanks & Regards
|
|
|
|
|
I would put this post in the Lounge not this forum.
We are not a Code Charity
|
|
|
|
|
hi friend i m very fresher in asp.net,
and i have to make a forum in asp.net.
for this i need that new forum creation.
for this there should be new page . iwant that when user clicks new button it automatically generate new web page named forum name and with all contents of previous page
|
|
|
|
|
Ok, you are asking for quite a lot.
To create a forum from scratch is a big job.
There is a good asp.net open source forum out there called YAF. http://www.yetanotherforum.net
Check this out.
We are not a Code Charity
|
|
|
|
|
i just want to know."how to create new web form on button click"
|
|
|
|
|
Do you want to create a new .aspx page on the fly?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Add a new form called WebForm2.aspx in IDE. On button click event, write Server.Transfer("WebForm2.aspx"). This will open just a blank aspx page.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Actually i need to create a webform which doesnt exist in our project.I need to create that form at run time
|
|
|
|
|
I am doing red color for particular item means like rows[1][3]
and these records in DataDable dt now not in GridView
after that
GridViewID.DataSource = dt;
GridViewID.DataBind();
so my code working in DataGrid but not in GridView
how to do in GridView also.
MyCode is:
DataRow drow = dt.NewRow();
drow[ddlFacilityName.SelectedItem.Text] = "<font color='Red'>" + m_dtCSV1.Rows[i][ddlFacilityName.SelectedItem.Text].ToString() + " is not found </font>";
"<font color='Red'>" working in DataGrid but not in GridView so what can I do in case of grid view.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
You need to set HTMLEncode Property of the GridColumn to False which is True by default. Use the design view Edit Columns option to change the property.
|
|
|
|
|
Hello, there,
I am using Ajax in an application page in SharePoint 2007. I found that when there is an exception. Ajax will show a dialog box says " Sys.WebForms.PageRequestManagerParserErrorException: The message
received from the server could not be parsed.", and the original exception message is not displayed.
I know I can use registerpostbackcontrol() function to register the button that causes the exception to make the original SharePoint error page to show up. But I do not want to do that. Is there any other way to make the original SharePoint exception/error page to show up?
Thank you very much.
Best regards,
Bin
|
|
|
|
|
Hi ,
i have one variable which holds datetime value like
8:00AM 07/02/2008
i want to get only time compoent from it how i do that .
any function which remove datepart from it
any help?
regards
Rameez
|
|
|
|
|
rameez Raja wrote: i have one variable which holds datetime value like
8:00AM 07/02/2008
Try this if work
string iTime=String.Format("{0:HH:mm}",Convert.ToDateTime("8:00AM 07/02/2008"));
Regards
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi,
I have a datagrid in which I have a select command column on clicking of it I am try to bind a dataset with detail view but I am getting the following error
The aspx code for it is
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DG_Example.aspx.vb" Inherits="DG_Example" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test Application</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="Generic_DG" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
DataKeyNames="ProdId"
OnSelectedIndexChanged="Generic_DG_SelectedIndexChanged3">
<Columns>
<asp:BoundField DataField="ProdName" HeaderText="Product" SortExpression="ProdName" >
<HeaderStyle Font-Names="Arial" Font-Size="12px" />
<ItemStyle Font-Names="Arial" Font-Size="12px" />
</asp:BoundField>
<asp:CommandField ShowEditButton="true" />
<asp:CommandField ShowSelectButton="true" />
</Columns>
</asp:GridView>
<br />
<br />
<asp:DetailsView ID="Generic_Det" runat="server" Height="50px" Width="125px"
DataKeyNames="ProdId">
<Fields>
<asp:BoundField DataField="ProdName" HeaderText="Product" SortExpression="ProdName" >
<HeaderStyle Font-Names="Arial" Font-Size="12px" />
<ItemStyle Font-Names="Arial" Font-Size="12px" />
</asp:BoundField>
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>
</div>
</form>
</body>
</html>
This is the code behind for it is as follows
Imports System.Data
Imports System
Imports System.Data.SqlClient
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data.OleDb
Imports System.Configuration
Partial Class DG_Example
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim constr = ConfigurationManager.AppSettings("connectionString")
Dim selConnection As SqlConnection
selConnection = New SqlConnection(constr)
Dim sqlcmd As string
sqlcmd = "select * from products"
Dim DGadapt As New SqlDataAdapter(sqlcmd , selConnection)
Dim DG_DS As New DataSet
DGadapt.Fill(DG_DS, "Demo")
Generic_DG.DataSource = DG_DS.Tables("Demo")
Generic_DG.DataBind()
End Sub
Protected Sub Generic_DG_SelectedIndexChanged3(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Dim constr = ConfigurationManager.AppSettings("connectionString")
Dim selConnection As SqlConnection
selConnection = New SqlConnection(constr)
Dim cmd As New SqlCommand()
cmd.CommandText = "select * from products where ProdID=@ProdId"
cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(e.Item.ItemIndex)
Dim adapt As New SqlDataAdapter(cmd.CommandText, selConnection)
Dim DT_DS As New DataSet
adapt.Fill(DT_DS, "Test")
Generic_Det.DataSource = DT_DS.Tables("Test")
Generic_Det.DataBind()
End Sub
End Class
and when I am trying to run the application I am getting the following error
Error 1 Method 'Protected Sub Generic_DG_SelectedIndexChanged3(sender As Object, e As System.Web.UI.WebControls.DataGridCommandEventArgs)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
How can I fix this bug?
Rock Star
|
|
|
|