Dear Sir,
while i have make sms send function then i have getting error.
please help me sir.
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error:
Line 148: }
Line 149:
Line 150: string PHONE_MOB = (row.FindControl("Label4") as TextBox).Text;
Line 151: string SMSurl = "http://185.255.8.59/sms/1/text/query?username=NTpc&password=NTpc@321&from=MUNPLA&to=+ PHONE_MOB +.&text=Your OCMS Complaint No:" + COMP_ID + " has been resolved successfully - Meja Urja Nigam PVT. LTD. &indiaDltContentTemplateId=1207164466650628862&indiaDltPrincipalEntityId=1201159222154902387";
Line 152: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(SMSurl);
|
Source File: c:\inetpub\wwwroot\OCMS\OCMS\admin.aspx.cs Line: 150 Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
OCMS.admin.Closed(Object sender, EventArgs e) in c:\inetpub\wwwroot\OCMS\OCMS\admin.aspx.cs:150
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9796242
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +211
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1696
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4465.0
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataKeyNames="COMP_ID" GridLines="Vertical"
OnRowDataBound="GridView1_RowDataBound" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" >
<AlternatingRowStyle BackColor="#DCDCDC" />
<Columns>
<asp:TemplateField HeaderText = "SL. No." ItemStyle-Width="10">
<ItemTemplate>
<asp:Label ID="lblRowNumber" Text='<%# Container.DataItemIndex + 1 %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comp. Id">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("COMP_ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Emp. Id">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("EMP_ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Emp.Name">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("EMP_NAME") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Phone. No.">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("PHONE_MOB") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comp. Msg." ItemStyle-Width="600">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("COMP_MESSAGE") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comp. Lodge. Dt." >
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("COMP_LODGE_DATE","{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>