473,549 Members | 5,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sys.ArgumentNul lException: Value cannot be null. Parameter name: element

70 New Member
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.ArgumentNu llException: 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="ViewU sers1.ascx.cs" Inherits="Contr ols_ViewUsers1" %>
<%@ Register Assembly="AjaxC ontrolToolkit" Namespace="Ajax ControlToolkit" TagPrefix="ajax Toolkit" %>
<ajaxToolkit:To olkitScriptMana ger runat="Server" ID="ScriptManag er1" />
<style>
/*Modal Popup*/.modalBackgroun d
{
background-color: white;
filter: alpha(opacity=7 0);
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($ge t("showModalPop upClientButton" ), 'click', showModalPopupV iaClient);
}

function showModalPopupV iaClient(ev)
{

alert(this.id );
document.getEle mentsByName("hd nDeleteID").val ue=this.id;

ev.preventDefau lt();
var modalPopupBehav ior = $find('programm aticModalPopupB ehavior');
modalPopupBehav ior.show();
}

function hideModalPopupV iaClient(ev)
{

ev.preventDefau lt();
var modalPopupBehav ior = $find('programm aticModalPopupB ehavior');
modalPopupBehav ior.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="Tr ue" AutoGenerateCol umns="False"
DataKeyNames="I D" OnPageIndexChan ging="gvUsers_P ageIndexChangin g" AllowSorting="t rue"
OnRowCommand="g vUsers_RowComma nd" OnRowDataBound= "gvUsers_RowDat aBound" PagerStyle-HorizontalAlign ="left"
OnSorting="gvUs ers_Sorting" OnRowDeleting=" gvUsers_RowDele ting">
<Columns>
<asp:TemplateFi eld Visible="False" >
<ItemTemplate >
<asp:Label ID="lbl" runat="server" Text='<%#Eval(" Email")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="ID" HeaderText="Use r ID" Visible="False" />
<asp:TemplateFi eld HeaderText="Fir stName" SortExpression= "FirstName" >
<ItemTemplate >
<%#Eval("FName" ) %>
</ItemTemplate>
<ItemStyle Width="15%" HorizontalAlign ="Left" />
<HeaderStyle HorizontalAlign ="Center" />
</asp:TemplateFie ld>
<asp:TemplateFi eld HeaderText="Ema ilAddress" SortExpression= "Email">
<ItemTemplate >
<%#Eval("Email" ) %>
</ItemTemplate>
<ItemStyle Width="30%" HorizontalAlign ="Left" />
<HeaderStyle HorizontalAlign ="Center" />
</asp:TemplateFie ld>
<asp:TemplateFi eld>
<ItemTemplate >
<a href='' name='<%#Eval(" ID") %>' id='<%#Eval("ID ") %>' onclick='javasc ript:$addHandle r($get(this.id) , "click", showModalPopupV iaClient);'>
Edit</a>
<%--<a href="#" name='<%#Eval(" ID") %>' onclick="javasc ript:return GetUserData('<% #Eval("ID")%>') " >Edit</a>--%>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld ShowHeader="Fal se">
<ItemTemplate >
<%--<asp:LinkButt on ID="LinkButton1 " runat="server" CausesValidatio n="False" CommandName="De lete"
CommandArgument ='<%#Eval("ID") %>' Text="Delete"></asp:LinkButton>--%>
<a href='' name='<%#Eval(" ID") %>' id='<%#Eval("ID ") %>' onclick='javasc ript:$addHandle r($get(this.id) , "click", showModalPopupV iaClient);'>
Delete</a>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
<PagerStyle HorizontalAlign ="Left" />
</asp:GridView>
</td>
</tr>
<tr>
<td>
<div class="demoarea ">
<br />
<asp:Button runat="server" ID="hiddenTarge tControlForModa lPopup" Style="display: block"
Visible="false" />
<ajaxToolkit:Mo dalPopupExtende r runat="server" ID="programmati cModalPopup" BehaviorID="pro grammaticModalP opupBehavior"
BackgroundCssCl ass="modalBackg round" TargetControlID ="hiddenTargetC ontrolForModalP opup"
PopupControlID= "programmaticPo pup" DropShadow="Tru e" PopupDragHandle ControlID="prog rammaticPopupDr agHandle"
RepositionMode= "RepositionOnWi ndowScroll">
</ajaxToolkit:Mod alPopupExtender >
<asp:Panel runat="server" ID="programmati cPopup" Style="display: none; width: 350px;
padding: 10px" BackColor="Whit e">
<asp:Panel runat="Server" ID="programmati cPopupDragHandl e" 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="btnCan cel_Click" />
</td>
</tr>
</table>
</asp:Panel>
</div>
</td>
</tr>
</table>
Dec 6 '07 #1
0 9810

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

Similar topics

12
4877
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 question twice! Here it is: I am having problems reading the value of a text Node. I think it has to do with the fact that the text is in a <span> tag....
21
3946
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 nothing in IE. I'd be greatful for any assistance. Also, if I will have problems the code on Opera or Safari, I'd appreciate any pointers--I don't...
5
3147
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 distilled the problem into the following code. Can anybody reproduce/explain the problem? Thanks, Daniel
13
10109
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 parent table. ----------------------------
5
1793
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
11025
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: ds.Relations.Add("ProjectToTestcase", _ ds.Tables("projects").Columns("projectID"), _ ds.Tables("testcasesnames").Columns("projectID")) The name of...
2
2490
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. Parameter name: pen at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at dh.OnPaint(PaintEventArgs e) at...
2
14645
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 can I pass null value as parameter to the database stored procedure programattically using C#? Although I can check for empty column (the...
4
2886
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 is not a null value. I am not using any code behind (C#) to bind the data or manipulate the data. I have read that when there is a null value in...
0
7455
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7480
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7814
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.