HomeHome Product Discus... Product Discus...Enhancement Req...Enhancement Req...variantID in querystring leads to a null reference exceptionvariantID in querystring leads to a null reference exception
Previous
 
Next
New Post
1/2/2013 1:05 AM
 
Hi there,

we have installed the trial version 5.25 on our system. With this version I treid to use the querystring parameters for a variant pre-selection but this results in a null reference exception. Here is what I tried to do:

- I created a variantgroup
- then I created variants to this group
- The variant still works in normal selection on the detailpage of the product
- then I tried to use the querystring:

http://192.168.67.46/SmithShop/SmithShopDetailpage/tabid/310/ProductID/4/Default.aspx?variantid=23

the variant is one of the displayed options in the variant grid of the product (in this case 4)

In the EventLog I get these 2 informations:

1.
>>>>
ModuleId: -1

ModuleDefId: -1

FriendlyName:

ModuleControlSource:

AssemblyVersion: 6.2.4

PortalID: 0

PortalName: TKS Telepost Kabel-Service

UserID: 10

UserName: alsc

ActiveTabID: 310

ActiveTabName: SmithShop Detailpage

RawURL: /SmithShop/SmithShopDetailpage/tabid/310/ProductID/4/Default.aspx?variantid=23

AbsoluteURL: /Default.aspx

AbsoluteURLReferrer:

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0

DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider

ExceptionGUID: 162f5fee-ec8b-425e-9747-27887bfd9216

InnerException: Object reference not set to an instance of an object.

FileName:

FileLineNumber: 0

FileColumnNumber: 0

Method: Smith.DNN.Modules.ProductDetail.ProductMain.m

StackTrace:

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Smith.DNN.Modules.ProductDetail.ProductMain.m() at Smith.DNN.Modules.ProductDetail.ProductMain.d(String vid) at Smith.DNN.Modules.ProductDetail.ProductMain.ProcessQueryString() at Smith.DNN.Modules.ProductDetail.ProductMain.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

Source:

Server Name: WWW1
<<<

2.
>>>


AssemblyVersion: 6.2.4

PortalID: 0

PortalName: TKS Telepost Kabel-Service

UserID: 10

UserName: alsc

ActiveTabID: 310

ActiveTabName: SmithShop Detailpage

RawURL: /SmithShop/SmithShopDetailpage/tabid/310/ProductID/4/Default.aspx?variantid=23

AbsoluteURL: /Default.aspx

AbsoluteURLReferrer:

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0

DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider

ExceptionGUID: 275cf811-2262-4743-8a8c-012c43960c04

InnerException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

FileName:

FileLineNumber: 0

FileColumnNumber: 0

Method: System.Web.UI.ControlCollection.Add

StackTrace:

Message: DotNetNuke.Services.Exceptions.PageLoadException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(String FriendlyMessage, Control ctrl, Exception exc, Boolean DisplayErrorMessage) --- End of inner exception stack trace ---

Source:

Server Name: WWW1
<<<

Does anybody have a advice vor me?



 
New Post
1/2/2013 7:03 PM
 
Hello,

I don't see a productid referenced in the querystring you provided. Your querystring should look something like the following:

http://www.yoursite.com/productdetails/Default.aspx?productid=4&variantid=23
 
New Post
1/2/2013 11:44 PM
 
Hi Kevin,

the productID is included. The Page uses friendly URL (configured in the web.config of DNN). This Option converts/splits each parameter of a querystring to slash separated url parts. See here:

http://192.168.67.46/SmithShop/SmithShopDetailpage/tabid/310/...
...ProductID/4...
.../Default.aspx?variantid=23

If I convert the requestURL to something like this:

http://192.168.67.46/SmithShop/SmithShopDetailpage/tabid/310/Default.aspx?productid=4&variantid=23

the same error occurrs.

Best regards,
Alex






 
New Post
1/7/2013 1:52 PM
 
Hi Alex,

Reading back over your initial post I see that you mention that "the variant is one of the displayed options in the variant grid of the product (in this case 4)".

Passing the ProductID and VariantID in the querystring is used for selecting items in a DropdownList, Checkbox list, or Radiobutton List. This feature has not been programmed to support adding a value in the Quantity box of a Grid Layout Display Type Variant on the Product Details page.

As a possible solution you may want to use the "Adding a Product Variants with Quantities to the
Cart" which will add the Product and Variants directly to the Cart. For more info in this feature please see Pg.255 of the Cart Manual at the following link: http://www.smith-consulting.com/Porta...

We are also available to program the ability to add a value in the Quantity box of a Grid Layout Display Type Variant on the Product Details page using the querystring. I will move this post to our Enhancement Requests forum to give others a chance to request this as well.

If you would like to team-up with another user, or your company has budget to sponsor this feature enhancement let us know, in most cases we can start work on the new feature within a week.

If you would like to prioritize a feature request to the top of the list do one of the following:
Submit a quote request here http://www.smith-consulting.com/servi...
Email sales@smith-consulting.com

Please let me know if you have any questions.

Thanks,
 
Previous
 
Next
HomeHome Product Discus... Product Discus...Enhancement Req...Enhancement Req...variantID in querystring leads to a null reference exceptionvariantID in querystring leads to a null reference exception