0

I am new to mvc and maybe to some of my question will seem naive.

I have this code in view Index.chtml page:

enter image description here

I need to create in src attribute of the frame element string that has two varaibles session and weblayout but, it seems I am doing it's wrong.

And value of the session and weblayout will not generated and will be like this:

/mapserver201x/mapviewernet/ajaxviewer.aspx?SESSION= + session + &weblayout= + weblayout

and I need it to be like this:

if value of session is:654276345234GSAKJD333,   
and value of weblayout is: Library://Exercise/WebCast/Hello.weblayout

the result should be:

    /mapserver201x/mapviewernet/ajaxviewer.aspx?SESSION=654276345234GSAKJD333 
&weblayout=Library://Exercise/WebCast/Hello.weblayout

Any idea how to implement it?

1 Answer 1

2
<frame src="/mapserver201x/mapviewernew/ajaxviewer.aspx?session=@ViewData["sessionId"]&weblayout=@ViewData["webLayout"]" />

All you've done in your example is assigned the value of those ViewData keys to JavaScript variables which won't work as you have expected.

You would definitely benefit from an introduction to MVC to get the basics.

Also, trying typing your code into your question instead of using an image, it makes it easier to apply an answer using your original code.

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.