.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Sohaib Khalid
Post New Web Links

First Form Submitting to second form action

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net

I have a site master page which has 2 forms on it like so

Html.RenderAction("Action", "Controller")
Html.RenderAction("Action2", "Controller")

in each form there is a submit button as follows

<%  Using Html.BeginForm()%>
<%= Html.TextBoxFor(Function(model) model.Parameter)%>
<input type="submit" value="" name="submit" id="submit" />
<%  End Using%>

But when I click the submit button in the second form on the page it submits the values from the first form to my controller and will run both controller actions. What I want is each form to submit only its own data is there some special way to do this?

View Complete Post

More Related Resource Links

Form Action Button to pass parameters through URL and how to fill a NewForm with them

Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

Anonymous users submitting Infopath forms via InfoPath Form Web Part

Is there a way for anonymous users in a public facing site to submit InfoPath List Forms via an InfoPath Form Web Part? Currently when I go to a page with the InfoPath Form web part configured as an anonymous users I get the following error message: Error loading the form A form template (.xsn) file cannot be accessed. You may not have the required permissions to open the file The list allows anonymous users permissions to add and view items When logged in the form works fine

Infopath Form Data submitting to Sharepoint 2010 List

Making a Client intake form that once submitted will send data to  a sharepoint 2010 List called contacts. Short Summary the form will have repeating fields and alot of information to submit. I have looked and read all over but I cannot find an easy step by step guild on how to submit the form data like that. Long Summary on the sharepoint site a button will open a form for adding a new client.  once the form has been filled out and the user hits submit sharepoint will then create a User File, in clients file, and take the data and put it into contacts list. I am trying to make use of Sharepoint as I would with access, meaning the more information I have on a client the easier it will be to mail merge letters, motions, basicly any file prepaired stuff. So once I have css designed forsharepoint to make it look the way I want then the forms should intergrate perfect

Error submitting browser enabled form using this.Submit()

I'm trying to submit my Infopath form by calling this.Submit() method from my button click event handler.  According to Microsoft - Note: You can write a custom submit event handler for the Submit event, and then you can programmatically call the event handler by using the Submit method. This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser. Its not working for me and throws this exception  - XmlForm.Submit cannot be called from the SubmitEventHandler. BTW - I'm able to submit same form without any problem if I don't use this "Submit()" method.  I really want to know why its behaving like this.  Looks like a BUG.  Thanks, Suhaib Khan

Problems submitting anonymous form via email.

I followd the steps here to configure an InfoPath form to be submitted anonymously. After much trial and error (I'm not a developer, and this was the first time I ever used Visua Studio), I got it working. I now want a second libary that uses pretty much the exact same form, but submits the completed form via email rather than into the document library. I made a copy of my first form template and then changed the submit connection to email. Unfortunately, when I publish this form and try to submit it, I get a error message that "there has been an error processing the form." Any ideas on what might be going on? Here is the working version that submits to the library. Here is the NOT working version.

Alternative way to do a form action='default.aspx'



I am using Masterpages and User Controls (ascx) files in my project.

It is not possible to do this on my ascx or masterpage,

<form id='frmAction' action='Default.aspx'></form>

Please could somebody give me an alternate way of doing the same, I need to postback to the same page, when user clicks on 'Submit'

sorry for not being very clear with what I want. I am trying to do a postback using jquery.


Kindly help with syntax.


Person picker value is not displayed in email when submitting form to email

I've created an InfoPath 2010 form to use in SharePoint 2010. When the user clicks the submit form button the current view of the form is being send to an email address. It works well except for person/group pickers. Those values come out blank in the email. I've gone through the HTML and the value from the pickers are not in the HTML at all. Do have to do something extra to have the values from the pickers in my email? 

Submitting a form for a dropdownlist


I have a dropdownlist for sorting a table as follows:

<% using(Html.BeginForm(Model.ActionName, Model.ControllerName, Model.RouteValues, FormMethod.Get))
{ %>
   <%: Html.LabelFor(m=>m.Sort) %>
   <%: Html.DropDownList("Sort", Model.Sort, new { onchange = "this.form.submit();") %> 
<% } %>

Which generates something like this:

<form method="get" id="form1" action="/mycontroller/myaction?param1=stuff&param2=otherstuff">
   <label for="Sort">Sort by</label>
   <select onchange="this.form.submit();" name="Sort" id="Sort">
      <option value="1" selected="selected">1</option>
      <option value="2">2</option>

Why does it submit as:


rather than:


Do I need to put param1 and param2 in hidden fields?

Passing data into a Sharepoint Designer Form Action workflow


I have a workflow that is triggered by a "Custom Action" on a "Form Action Button" that I added to a DataFormWebPart in SharePoint Designer. So the workflow isn't associated to any list or document library. What I need to do is pass some data to this workflow so that it can do some useful stuff.

I see from here that Natalya Voskresenskaya shows a method that allows you to pass a single list item value into a workflow variable but if you hack this into the aspx file as suggested, when ever you subsequently open design view and the workflow on the button again, all the hacks are removed by SPD.

I have tried this method and it seems to work for one variable, but I cant figure out how to pass more than one. Here is another post that is very similar but slightly different.

In this post Ibrahim said on April 1st 2008:

"I am having difficulty building a Javascript string for my particular requirement; SPD had already built a concat

Custom Form Field in Collect Data Action doesnot capture multiple users.


I have a situation where the department head dynamically assigns the reviewers depending on the document that is uploaded. To capture the reviewers I added a Collect Data Action and a "Reviewers" form field, with type "Person/Group" and checked the following properties

1. Allow selection od People and Groups, 2. Choose from all users and more importantly 3. Allow multiple users

Although I am able to enter multiple users in the form, I am able to retrieve only the first user I entered and the rest just.. disappear!

SharePoint Designer: Sending parameters with "Navigate to Page" form action

I want to create a custom button in my SharePoint form that uses Form Actions that commit the changes in the fields and then navigate to a designated page.  This works very well.

Then I want to send a parameter with the URL, for example: http://.../customform.aspx?ID={@ID}.  SharePoint Designer offers this option, but I have not been able to make it work.  Every time it just sends the literal {@ID} instead of it's content.

Has anyone solved this issue?

Error submitting InfoPath Web Form

I recieve a message "The form cannot be submitted because of an error" when submitting to a SP Doc Lib.  Design Checker doesn't register any errors.  I have checked the form and don't see anything that would cause the error.  I have also compared the DL columns with the form to ensure they match.  Not sure how to check on the server for this error....

How to pass parameter in sharepoint form action "Navigate to page"

I'm new to MOSS 2007, currently working on the SharePoint form.
In the NewForm.aspx page, once user entered all the fields and click on the "save" button, the data will be save into the list and also i tried to redirect it to other page.

I read few articles on this issue, most of it is about redirect to same directory but different page. Example: Allform.aspx, Display.aspx or editform.aspx.

I wanted to redirect to different path page.
javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://server/test/myForm.aspx}')}". This line works when i click on the "save" button.

Assume i wanted to pass a title parameter to directed page.
javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://server/test/myForm.aspx?PageTitle_x003D__x007B_@Title_x007D_}')}  <=== this line not working, what i get from the directed page by using querystring is "{@Title}". 

How can i pass the parameter to directed page and read the value?

Anyone can help me on this?


InfoPath form not displaying after submitting


I created a new InfoPath form and published it to my Team SharePoint site, allowing InfoPath to create the form library.  The issue I am having is when I submit a "New Document" the completed item does not display on the site after I click submit.  The only way I can tell the item is there is to go to "View All site Content" and there I can see a count of how many examples I have submitted.  I am not sure why the submitted items will not show.  Any  guidance in resolving this issue would be greatly appreciated.


InfoPath form Submitting Issue



I am having prob while submitting the infopath form in the form lib.

1. Actually i ve published 3 infopath form in a single form lib.All forms are full trusted and all fields on each form are same.Problem is that if the form lib is empty then form successfully submit in the form lib but if there is any from available in the form lib then it doest not submit, shwoing error " An error occured while the form was being submited". And then i tried to submit from the form design preview level then it says ".....The form cannot be submitted to the following location: http://server/site/formLib/10001_6644000_2010-11-09T15_18_44_69.xml. Folder doest not exist."

2. Then i deleted all content type from the from lib settings. Then i did open the infopath form in design mode and submited at preview level then it was successfully submited to that form lib(eithere form lib is empty or not empty).

3. Above whole process i ve successfully completed in development server but in the production server i m facing this type of problem. i am unable to find out the solution. even i ve deleted the form lib and then i ve recreated again. Pls help me.

Thanks in Advance.

Regards- Sharad

InfoPath Form Save Option before Submitting the data


I want to have a save option for user to save the inforpath form, so that later they can submit the form instead of directly submitting the form. How do I provide this feature?


mapping the url of a web form page to a mvc action


hi guys, 

I am upgrading my website to a mvc website. 

I have following urls in my blog section ;


as you see article query string will have the id of the article. in my new mvc app, I wiil display my blogs on www.example.com/40

here, 40 is the id of the article.

problem is that the search engines have my current url and if I upgrade my app to mvc app, the links will be broken. so what is the best way of mapping those url in an mvc app. thanks !

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend