Wednesday, February 4, 2015

user control

x.ascx
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="x.ascx.vb" Inherits="xxx" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<script language="javascript" type="text/javascript">  

x.ascx.vb
Public Class xxx
    Inherits System.Web.UI.UserControl

in ascx the control grid view when bind to data source, then in ascx Javascript has access to the data source

ex id is part of the data field in the data souce
then you can  have javascript in ascx file

if (id !=null)
{
}
else
{
}


No comments:

Post a Comment