472,982 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

Sys.ArgumentNullException: Value cannot be null. Parameter name: element

Hi all

I am using the Ajax control toolkit and want to the fill the gridview but at the time of rendering it occurs the error "Sys.ArgumentNullException: Value cannot be null. Parameter name: element". Here am posting the whole .ascx page.

Will you please let me know how can i remove this error.






<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ViewUsers1.ascx.cs" Inherits="Controls_ViewUsers1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
<style>
/*Modal Popup*/.modalBackground
{
background-color: white;
filter: alpha(opacity=70);
opacity: 0.7;
}
</style>


<script type="text/javascript">
var styleToSelect;

// Add click handlers for buttons to show and hide modal popup on pageLoad
function pageLoad()
{

$addHandler($get("showModalPopupClientButton"), 'click', showModalPopupViaClient);
}

function showModalPopupViaClient(ev)
{

alert(this.id );
document.getElementsByName("hdnDeleteID").value=th is.id;

ev.preventDefault();
var modalPopupBehavior = $find('programmaticModalPopupBehavior');
modalPopupBehavior.show();
}

function hideModalPopupViaClient(ev)
{

ev.preventDefault();
var modalPopupBehavior = $find('programmaticModalPopupBehavior');
modalPopupBehavior.hide();
}



</script>

<table width="100%" id="ParentTable">
<tr>
<td>
<input type="hidden" id="hdnDeleteID" runat="server" />
<asp:Label ID="lblMessage" runat="server"></asp:Label>
<asp:Label ID="lblGridMess" runat="server" />
<asp:GridView ID="gvUsers" Width="100%" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="ID" OnPageIndexChanging="gvUsers_PageIndexChanging" AllowSorting="true"
OnRowCommand="gvUsers_RowCommand" OnRowDataBound="gvUsers_RowDataBound" PagerStyle-HorizontalAlign="left"
OnSorting="gvUsers_Sorting" OnRowDeleting="gvUsers_RowDeleting">
<Columns>
<asp:TemplateField Visible="False">
<ItemTemplate>
<asp:Label ID="lbl" runat="server" Text='<%#Eval("Email")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ID" HeaderText="User ID" Visible="False" />
<asp:TemplateField HeaderText="FirstName" SortExpression="FirstName">
<ItemTemplate>
<%#Eval("FName") %>
</ItemTemplate>
<ItemStyle Width="15%" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="EmailAddress" SortExpression="Email">
<ItemTemplate>
<%#Eval("Email") %>
</ItemTemplate>
<ItemStyle Width="30%" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<a href='' name='<%#Eval("ID") %>' id='<%#Eval("ID") %>' onclick='javascript:$addHandler($get(this.id), "click", showModalPopupViaClient);'>
Edit</a>
<%--<a href="#" name='<%#Eval("ID") %>' onclick="javascript:return GetUserData('<%#Eval("ID")%>')" >Edit</a>--%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<%--<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%#Eval("ID")%>' Text="Delete"></asp:LinkButton>--%>
<a href='' name='<%#Eval("ID") %>' id='<%#Eval("ID") %>' onclick='javascript:$addHandler($get(this.id), "click", showModalPopupViaClient);'>
Delete</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle HorizontalAlign="Left" />
</asp:GridView>
</td>
</tr>
<tr>
<td>
<div class="demoarea">
<br />
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: block"
Visible="false" />
<ajaxToolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup" BehaviorID="programmaticModalPopupBehavior"
BackgroundCssClass="modalBackground" TargetControlID="hiddenTargetControlForModalPopup"
PopupControlID="programmaticPopup" DropShadow="True" PopupDragHandleControlID="programmaticPopupDragHan dle"
RepositionMode="RepositionOnWindowScroll">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel runat="server" ID="programmaticPopup" Style="display: none; width: 350px;
padding: 10px" BackColor="White">
<asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move; background-color: #DDDDDD;
border: solid 1px Gray; color: Black; text-align: center;">
User</asp:Panel>
<table width="200px">
<tr>
<td align="left">
Delete User
</td>
</tr>
<tr>
<td align="center">
Are you sure to delete the user?
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="btnOk" runat="server" Text="OK" OnClick="btnOK_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
</td>
</tr>
</table>
</asp:Panel>
</div>
</td>
</tr>
</table>
Dec 6 '07 #1
0 9692

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
5
by: Daniel Gackle | last post by:
I'm getting a strange ArgumentNullException after deserializing a SortedList. Haven't seen this discussed in the newsgroups, but it looks like a bug - unless I missed something obvious? I've...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
5
by: patrin | last post by:
Hi All, given the source document: <?xml version="1.0" encoding="UTF-8"?> <root> <child> <test id="1" name="first child"/> </child> <child>
1
by: florinake | last post by:
The following error occurs when I want to make a relation between two tables : "System.ArgumentNullException: 'column' argument cannot be null" . The code where appears the exception: ...
2
by: Tom C | last post by:
This error occurs erratically at startup. It appears to be all native code. Does anyone have any idea what the heck could be cauing this? System.ArgumentNullException: Value cannot be null....
2
by: qwedster | last post by:
Folk! How to programattically check if null value exists in database table (using stored procedure)? I know it's possble in the Query Analyzer (see last SQL query batch statements)? But how...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.