Click here to Skip to main content
15,892,674 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionClick Event of dynamically created Link Button is not working Pin
Ravindra Bisen4-Jul-10 17:53
Ravindra Bisen4-Jul-10 17:53 
AnswerRe: Click Event of dynamically created Link Button is not working Pin
Sandeep Mewara4-Jul-10 18:32
mveSandeep Mewara4-Jul-10 18:32 
GeneralRe: Click Event of dynamically created Link Button is not working Pin
Ravindra Bisen4-Jul-10 18:39
Ravindra Bisen4-Jul-10 18:39 
GeneralRe: Click Event of dynamically created Link Button is not working Pin
Sandeep Mewara4-Jul-10 18:40
mveSandeep Mewara4-Jul-10 18:40 
AnswerRe: Click Event of dynamically created Link Button is not working Pin
Nishant Singh5-Jul-10 20:28
Nishant Singh5-Jul-10 20:28 
AnswerRe: Click Event of dynamically created Link Button is not working Pin
vishnukamath5-Jul-10 23:56
vishnukamath5-Jul-10 23:56 
GeneralRe: Click Event of dynamically created Link Button is not working Pin
Ravindra Bisen7-Jul-10 1:10
Ravindra Bisen7-Jul-10 1:10 
AnswerRe: Click Event of dynamically created Link Button is not working Pin
raju melveetilpurayil6-Jul-10 3:54
professionalraju melveetilpurayil6-Jul-10 3:54 
Check this, it will help you.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dynamicButton.aspx.cs" Inherits="dynamicButton" %>

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </div>
    </form>
    <script >
        function jsEvent() {
            alert("hai");
        }
    </script>
</body>
</html>






using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class dynamicButton : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Button button = new Button();
        button.ID = "Button1";
        button.Text = "DynaicButton";
        button.Attributes.Add("onclick", "return jsEvent();");
        button.Click += new EventHandler(button_Click);
        PlaceHolder1.Controls.Add(button);
    }
    protected void button_Click(object sender, EventArgs e)
    {
        Response.Write("Server Event: From Dynamic Button");
    }
}

Raju.M

GeneralRe: Click Event of dynamically created Link Button is not working Pin
Ravindra Bisen7-Jul-10 1:01
Ravindra Bisen7-Jul-10 1:01 
GeneralRe: Click Event of dynamically created Link Button is not working Pin
raju melveetilpurayil7-Jul-10 8:44
professionalraju melveetilpurayil7-Jul-10 8:44 
QuestionUsing ASP_Local_Resources and Ajax Pin
FJJCENTU4-Jul-10 6:15
FJJCENTU4-Jul-10 6:15 
QuestionHow to load multiple images from SQL 2008 Database into GridView Pin
Dominick Marciano3-Jul-10 23:34
professionalDominick Marciano3-Jul-10 23:34 
AnswerRe: How to load multiple images from SQL 2008 Database into GridView Pin
Not Active4-Jul-10 2:59
mentorNot Active4-Jul-10 2:59 
GeneralRe: How to load multiple images from SQL 2008 Database into GridView Pin
Dominick Marciano4-Jul-10 5:40
professionalDominick Marciano4-Jul-10 5:40 
GeneralRe: How to load multiple images from SQL 2008 Database into GridView Pin
Not Active4-Jul-10 11:30
mentorNot Active4-Jul-10 11:30 
GeneralRe: How to load multiple images from SQL 2008 Database into GridView Pin
Dominick Marciano5-Jul-10 17:45
professionalDominick Marciano5-Jul-10 17:45 
AnswerRe: How to load multiple images from SQL 2008 Database into GridView Pin
koolprasad20035-Jul-10 2:10
professionalkoolprasad20035-Jul-10 2:10 
Questioncompiler executable file csc.exe cannot be found error Pin
K.Safvi2-Jul-10 9:44
K.Safvi2-Jul-10 9:44 
AnswerRe: compiler executable file csc.exe cannot be found error Pin
Ankur\m/2-Jul-10 21:26
professionalAnkur\m/2-Jul-10 21:26 
Questionweb installer interruption [modified] Pin
Chesnokov Yuriy2-Jul-10 7:55
professionalChesnokov Yuriy2-Jul-10 7:55 
AnswerRe: web installer interruption Pin
Sandeep Mewara4-Jul-10 18:39
mveSandeep Mewara4-Jul-10 18:39 
AnswerRe: web installer interruption Pin
Dinesh Mani4-Jul-10 23:01
Dinesh Mani4-Jul-10 23:01 
QuestionDropDownList triggering an UpdatePanel Pin
Lonnie Raffray2-Jul-10 4:49
Lonnie Raffray2-Jul-10 4:49 
AnswerRe: DropDownList triggering an UpdatePanel Pin
Sandeep Mewara2-Jul-10 5:02
mveSandeep Mewara2-Jul-10 5:02 
QuestionPHP or ASP.Net for developing Web based application with SAAS Pin
nilam24772-Jul-10 1:37
nilam24772-Jul-10 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.