1

I have a user control which accepts an 'Id' from the page where it is embedded. I used the following code to display " <% Html.RenderPartial("ViewUserControl3", Model.Guid); %>" to display the user control with specific id on the page. Any one please help me How to get that Guid in my usercontrol page and display the user control on the page where it is called.

Thanks in Advance

1 Answer 1

1

Your ViewUserControl3 should be strongly typed to Guid and then simply use this model:

<%@ Control 
    Language="C#" 
    Inherits="System.Web.Mvc.ViewUserControl<System.Guid>" %>

<div><%= Model %></div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.