1

I have a web page (one of many). But on this particular web page the following doesn't render.

@using (Html.BeginForm()) {
     <h1>bbbbbbbbbbbbbbbbbbbbbbbbbbbb</h1>
 }

The only difference between this and other web pages is that I have dynamically created this link to this page with jQuery rather than hardcoding the link on the page. When I check the link it looks like this:

<a href="/adminStats/Edit?PartitionKey=P22&amp;RowKey=01-01-0001">Edit</a>

Is there something about BeginForm that can't see the page address so it doesn't create the form link?

Robert

1
  • how are u passing link address? Commented May 15, 2011 at 9:58

2 Answers 2

9

I had the same problem. Check for nested form tags.

Sign up to request clarification or add additional context in comments.

1 Comment

I added an end form tag (</form>) to the top of my modal view (above the new form) to quickly verify this was the problem.
0

I'm assuming that if you don't specify the route values, BeginForm will try to create the form action based on the current request context. That being said, if that's not the current view's URL then it shouldn't matter. So, in the end, I would say that that link has no effect on BeginForm, but something that BeginForm needs from behind the scenes (out of your control) is not available, and thus BeginForm is silently failing.

You can try exploring the source for BeginForm and see what potentially might be missing...

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.