Hello Guys,
Sometimes we require conditional based update panel, so that we don't need to keep entire evnets in one
update panel. We can make a trigger to handle events with on condion based. Here is the example;
Default.aspx page
Sometimes we require conditional based update panel, so that we don't need to keep entire evnets in one
.Net Three Tier Architecture, 1NF, 2nd Highest Salary, 2NF, 3NF, Ajax, ASP.Net 4.0, Auto Complete, auto number, Backup Database, BL and DAL, blame, breakfast, checkbox checked, Clustured, Commit, Compress, Create Curosr, CSS, Database Mail, dear, DECLARE Cursor, Delete Duplicate Records, faster query, Form, Generate SQL Scripts, get I.P address of server in asp.net, GridView, GridView Sr. no, human, I.P, Imp Query, Index, inside page, javascript, JQuery, lifestyle, LOCK, luxury, Mail sending via SQL Database, Managment, mercy, Non clustured, Normalization, old people, Optimize the Page, Paging, PL, Rollback, Row data bound, Row Deleting, Scheduled Backup database, selecetion change, SQL, SQL 2008, SQL 2008 Scripts, SQL Commands, SQL Cursor, SQL data Scripts, SQL Database Maintenance, sql query, SQL Scripts, SQL Scripts Backup, SQL Send Mail, SQL Server 2008, SQL Transaction, time, today, Truth, user control, user control inside page, validatation using javascript, Web Service, Web.Config, with no lock
Default.aspx page
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default"
%>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
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">
<asp:scriptmanager ID="Scriptmanager1" runat="server">asp:scriptmanager>
<div>
<asp:UpdatePanel ID="updt1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblMsg" runat="server">asp:Label>
ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnClick" EventName="Click" />
Triggers>
asp:UpdatePanel>
<asp:Button ID="btnClick" runat="server" Text="Click Me" onclick="btnClick_Click" />
div>
form>
body>
html>
Default.aspx.cs page
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblMsg.Text = "Hello, Guest";
}
}
protected void btnClick_Click(object sender, EventArgs e)
{
lblMsg.Text = "Hello, Ved Pathak";
}
}
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblMsg.Text = "Hello, Guest";
}
}
protected void btnClick_Click(object sender, EventArgs e)
{
lblMsg.Text = "Hello, Ved Pathak";
}
}
Comments