+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / DataItemId that isn't a GUID

DataItemId that isn't a GUID

6 posts, 2 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    29 Nov 2010
    Link to this post
    How do we go about swapping views when my itemid is an integer?
    Response.Redirect(CreateHostViewCommand("ExerciseEditView", id.ToString(), null));

    this.DataItemId is a Guid...

    Should I just check the "Param" querystring variable instead of this.DataItemId?  Will that cause any issues? :)
  2. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    29 Nov 2010
    Link to this post
    Hi Steve,

    We ran into the very same problem in the project that i was working on and we ended up using the Param querystring variable which worked properly and we didn't face any problem with it.

    Cheers,

    G
    Answered
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Nov 2010
    Link to this post
    Hello,

    You can use CmsHttpRequest.Current.QueryStirng[this.ParameterKey], but this is what DataItemId does. If using the CmsHttpRequest.Current.QueryStirng and DataItemId return null then there should be something wrong with the view routing.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    29 Nov 2010
    Link to this post
    Well no it's working, it's just my datakey is an Int32, and DataItemId is Guid

    Routing is working perfect
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Nov 2010
    Link to this post
    Hi Steve,

    Edit, Preview, Insert commands are virtual methods and you can override them and return a method with an integer. The base methods expect a valid Guid.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  6. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    29 Nov 2010
    Link to this post
    Ahhh, I did not see that thanks guys
Register for webinar
6 posts, 2 answered