Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  DNN 4.5.3 Using ClientAPI in C# Question
Previous Previous
 
Next Next
New Post 3/3/2008 1:57 PM
User is offline Tigris7
166 posts
9th Ranked


DNN 4.5.3 Using ClientAPI in C# Question 

I am attempting to pass the selected value from a dropdownlist to a client side function but my code throws a 'Object reference not set to an instance of an object' exception when I try to register the client side variable. Please take a look and see if you can help.

in the .ascx file I have

<asp:DropDownList ID="DDL_Report_List" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DDL_Report_List_SelectedIndexChanged" />

<script type="text/javascript" src="/js/des.js"></script> 

In the ascx.cs file in the page load I have:

 protected void Page_Load(object sender, EventArgs e){protected void DDL_Report_List_SelectedIndexChanged(object sender, EventArgs e)  

{

  if (!IsPostBack)    

   {ReportingService2005 rs = InstantiateRS(); 

 

     Get_Report_List(rs);

     Bind_DDL_Report_List(DDL_Report_List); }

  else  {

if (DDL_Report_List.SelectedIndex != 0) {

 

     strURL = DDL_Report_List.SelectedValue;

     if(ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML))

     ClientAPI.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn); 

     try     {ClientAPI.RegisterClientVariable(this.Page, "rURL", strURL, true);}   //THIS IS THE LINE THAT THROWS THE EXCEPTION

     catch (Exception ex){ string temp = ex.ToString();}

    DDL_Report_List.SelectedIndex = 0;

  }

}

 

And then

 

string getReport = DDL_Report_List.SelectedValue; 

if(DDL_Report_List.SelectedIndex==2) //set global variable

strURL = @"http://10.0.3.40/Reports/Pages/Report.aspx?ItemPath=/BrokerReports/" + getReport;}

else //set global variable

strURL = @"http://10.0.3.40/Reports/Pages/Report.aspx?ItemPath=/BrokerReports/" + getReport + "?ReportID=CPC1&Firm=E&&rc:parameters=False&rc:Toolbar=false"

}

 In the js file I have:

function

{

var url = dnn.getVar('rURL');

 

window.open(url, "one", "left=10, top=10, width=600, height=800, location=no, menubar=no, resizable=no, scrollbars=no, status=no, titlebar=no, toolbar=no");

}

I have read the ClientAPI help doc and thik I may have to use ClientAPI.RegisterPostBackEvent, but can't quite grasp everything I am to do. Any help would be greatly appreciated. Thanks in advance

GetRpt()

protected void DDL_Report_List_SelectedIndexChanged(object sender, EventArgs e)

private string strURL;

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  DNN 4.5.3 Using ClientAPI in C# Question
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNN Outsourcing
50% more affordable services comparing to Western Europe and US: Custom DotNetNuke module development, skins, consulting, maintainence... Over 15.000 working hours of experience in custom DotNetNuke Solutions development, 8 years experience in outsourcing, excellent references!
www.dnnoutsourcing.com
Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au
Softech Development, Inc.
We help your business work smarter with DotNetNuke. Whether you need a new implementation, a custom module or skin for an existing implementation, or integration with your business processes, Softech has the experience and expertise to make it happen.
www.softechdevelopment.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP