473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 9764

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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.