Getting Error After Post While Using Dropdown In Mvc Website
Aug 1, 2010
i am getting error after post, when i am using dropdown in my mvc website, the code is as follows
ViewData["JobSite_JobCategories1"] = new SelectList(context.JobSite_JobCategories, "Id", "Category", null);
<%= Html.DropDownList("JobCategory", ((IEnumerable<SelectListItem>)ViewData["JobSite_JobCategories1"]))%>
<%= Html.ValidationMessageFor(model => model.JobCategory) %>
The validation is not working, and also after i catch error i fill the viewdata["JobSite_JobCategories1"] with selectlist again but still, it gives error There is no ViewData item of type 'IEnumerable' that has the key 'JobCategory'.
View 1 Replies
Similar Messages:
Aug 10, 2010
I have a website installed on one of our sales guys laptops and am having issues with the website hanging if left for 2 minutes. This doesn't happen on my dev box, my live machine or the other sales guys machine.
The website will hang. It's not just limited to this page, it will happen on all pages when I leave it for more than 2 minutes and then try and process a page that calls back via button or drop down ect. I have checked the IIS settings of the machine and everything seems the same as the other sales guys machine who is running the same version of the site.
Here are the specs:
Dev Box: asp.net 2, windows server 2008 64bit
Live Box: asp.net 2, windows server 2008 64bit
Working Sales Guy: asp.net2 windows 7 64bit
Broken Sales Guy: asp.net 2 Windows vista 32 bit (the only thing I can see different is windows version)
EDIT: For more information, if I stop the website from trying to load while it hangs, clear my history for the last hour and then refresh, the page comes back fine.
EDIT2: I have just spat out some debug information and it seems it doesn't even go into the post back I need.
EDIT3: This doesn't seem to happen when using Chrome but does when using IE and Mozilla.
View 1 Replies
Feb 16, 2010
I've been reading through the fb developer api documentation and I'm trying to find out what would be the easiest way to post information on a website to the website's own facebook page. for instance - the assumed workflow is like this:
an admin user adds new content to the company website - and once submitted that content should automatically appear as a link on the company's facebook page.
Do I use the API, facebook Connect, a facebook Share button etc. Looking for some recommendations based on my assumed workflow. Project will be coded in c# (although I'm really looking for recommendations of which tool to use from someone's experiences with the api)
View 1 Replies
Jan 23, 2011
@using (Html.BeginForm("Index", "Bill"))
{
@Html.Label("FromDate")
@Html.DropDownList("FromDate",Model.DateList)
@Html.Label("ToDate")
@Html.DropDownList("ToDate", Model.DateList)
@Html.ActionLink("Filter", "Index", "Bill") // I want to post to Index
}
[HttpPost]
public ActionResult Index(string fromDate, string toDate)
{
//Process
}
What is the correct way to post the date range to Index action?
What kind of URL do I need to specify?
View 1 Replies
Jun 7, 2010
I have an aspx page for Search Options. There are three aspx Dropdown List Controls that are each bound to seperate data sources. The selection made in the Dropdown control is used in a SQL Query within a GridView data source to display the results list.
When I select an item from the drop down list I get the search result, but I want the drop down list to return to it's initial state after it displays the result, so the next selection made will clear the results list from the first selection. I have tried a number of different approaches, but no success. Seems like this should be easy, but I'm new to coding.
I have found a couple of possibles on the forum, but they didn't work. Not sure if you can make any sense of this, but I'll try to give you something more to go on. All I really want to do is reset the dropdown after it displays the results of the search, which I assume is after a PostBack. Here is what I have tried in the Code Behind or Script.
This for just one of the Dropdown Lists, ID=Practices. I have been trying to make this work for way too long. Also, I have tried it with AutoPostBack set to true but same problem. Currently have a 'Submit" button on the page to initiate the search.
[code]....
View 11 Replies
Feb 21, 2011
I add cascading drop down in a place holder during page load. When i submit the entire form, i found out that my drop down list is reload and my selected value is not selected.
View 3 Replies
Nov 29, 2010
i have a place order form and i have a drop down list that contains list of items whenever i add item (for example item1) to place order and click add another item button, i need to remove (item1 ) from drop down list to avoid dupplicate insert in sql table or mayb need to fill the drop down but without (item1) cause i already selected it i am using sql datasource to fill the drop down list of items.
View 13 Replies
Jun 6, 2010
In my project I used a dropdown list which databind as follows:
My drop downlist code as follows:
[code]....
* My proble is when I Change the Index Selection My dropdownlist automatically post back and it loses its Selected Index and move to Index=0
* When I press any server control e.g. button it also behave as previous.
View 10 Replies
Mar 18, 2011
i am really confuse about the html dropdown helper. i cant reli find one info which describe clearly about every overload and how to use them.currently i gone through a problem which i spent one day and still cant resolve it, really hope can get the help here since i need to make tis work for my final year project..i have a food table, and a foodtype table. each food will have a type, so the FoodTypeID is the FK for Food table.i want to have a create and edit page for Food. on the page, i want to provide a dropdownlist for user to select the food typethe FoodTypeName column that store the food type description is at the FoodType table, so i need to get the value of FoodTypeID based on user selection on the dropdown.I had tried for hourssss to do this bt i either get a compilation or cant save the new foodType selected in db
[Code]....
in fact, i not reli understand wat should be put inside the model => xxx and the dropdown helper overload, i am writing this based on the mvc tutorial
View 12 Replies
Aug 11, 2010
my code as below:
1) I have set EnableViewState = True
<%@ Page Language="VB" MasterPageFile="~/en/en.master" AutoEventWireup="false" CodeFile="product_detail.aspx.vb" Inherits="en_product_detail" EnableViewState="true" %>
2) I have set AutoPostBack & EnableViewState = True
<asp:DropDownList ID="ddl_order" runat="server" AutoPostBack="true" EnableViewState="true">
</asp:DropDownList>
View 5 Replies
Jun 24, 2010
I have a page where in there are various entry fields like name, registration number, country, state etc whcih are mandatory. On selection of country in dropdown,the state dropdown is filled and in the phone number boxes the country code is also filled simultaneously.
When I click on Save button it shows the required fields respective messages in the validation summary. When I select the country the state and country code are filled and the validation summary vanishes though I have not entered text in the other mandatory fields. None of the required fields messages are displayed though all fields except Country state and country code are filled.
View 4 Replies
Feb 14, 2010
I have 3 drop downs in a details view (populated from a gridview) during insert mode.
Dropdown 1
Dropdown 2 --> Based on drop down one
Dropdown 3 --> Based on drop down two
I am curious of how to handle the autopostback to update 2 and 3 since they are part of the detailsview, there isn't a selected_index_changed event.
I am ok with adding items to them on page load, just not for cascading of them...
View 5 Replies
Feb 10, 2010
I have been using the RemotePost Class( as per http://www.jigar.net/articles/viewhtmlcontent78.aspx) to post a form to a pay provider, for about 3 months successfully, I made some changes external from the call to this class that sent an email when user presses the button to notify us that the user has selected to go through to the pay provider (similar to PayPal). and suddenly got an exception error MSCROLIB, Thread was being aborted. I have since removed the code and I still get the error it happens when I call
[Code]....
I tried the suggestion on KB article [URL]/ but the control is not past to the Pay Provider I also took the actual response that is written and posted it to a new html file added a submit button and it works. So I am no stuck. The Pay provider claims they have changed nothing, and has tried to help but says they are receiving no input from either our dev site or the live site.I also tried to step into the call but it just throughs the exception
View 4 Replies
Feb 6, 2010
I want to create a web application that can post article or blog on different website automatically.
Like in wordpress (php) there is a plugin support for this, so is there any plugin or anything else from which i can achieve my requirements?
View 3 Replies
Mar 28, 2013
i want post method to implement for my c# code,,,,and how to redirect that in anoth aspx file...
View 1 Replies
Feb 14, 2011
I'm currently developing a website using ASP.NET MVC.I need this website to communicate with an external API using HTTP Post.
I'm unsure whether I should be coding this up in ASP.NET to perform the http post requet and read the response, or whether I should be coding this up in a c# class.It seems when developing a site, you have the option to chose either for many scenarios.
View 3 Replies
Mar 1, 2011
I need to make an online automatic post tool using ASP.NET C# to post items (using post or get) to ASP (VB script) webstore sites, for example how to capture the post data and how to reproduce it using ASP.NET C#.
how to upload post and get variables also with cookies
View 1 Replies
Aug 28, 2010
I know this is a simple thing but i donīt how to.....
I have the website working on my pc .... but i want to get it online with the database.
Do i have to put debug to false to publish it?
View 4 Replies
Mar 16, 2010
I'm using an ASP.NET Facebook Developers Toolkit (http://www.codeplex.com/FacebookToolkit) on an external website, and I'm also the admin of a facebook fan page for the website. Users on my website (may or may not be facebook users) create content articles.
I would like to hook up these articles to the Facebook fan page, so that, when they write the article, then ones with FB accounts can sign into FB and post on the Fan page. I'm sure they would need to be a fan first.
View 1 Replies
Aug 30, 2010
I have a php website with a login page containing username and password fields with the same exact html names. I would like to have a page in my ASP.NET page with a username and a password textbox field that sends the corresponding credentials to the php website using HttpWebRequest. How would I do that and how could I check the response to see if the authentication has been successful?
View 1 Replies
Nov 6, 2010
My host moved my website to a new server. The DNS configuration is correct but the website is still down and I'm getting this message
"unable to open website at www.aboutmecfs.org. Internal Server error"
View 9 Replies
Mar 6, 2010
I have a new development machine running windows 7 professional 64 bit. On loading up a website project Im getting this error
'The Web Application Project 'websitename' is configured to use IIS. To access local IIS websites, you must install IIS components:
IIS 6 Metabase and IIS 6 Configuration Compatibilty
ASP.net
Windows Authentication
In addition you must run Visual Studio in the context of an administrator account
As far as Im aware, I am an administrator of my own pc and I have the .net framework installed.
View 4 Replies
May 12, 2010
I need to send some parameters to an external website using the <asp:HiddenField /> controls and also at the same time, submit data to a sql server database. The part for submitting the data to the database is working, but I need to try to get the parameters from the hiddenfields to also be passed through. I thought all I had to do is create the hidden fields and in the code behind, set the values from the textboxes that the user would fill out.
My source code is below:
[code]...
What am I missing? The hidden fields are losing their value before posting to the external website. I've looked everywhere to see why this won't work.
View 2 Replies
Oct 29, 2010
I am getting an error on javascript when doing post back. The code is as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" [URL]>
<html xmlns=[URL]>
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function DoPostBack()
{
__doPostBack('Button2','My Argument');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" id="Button2" value="Press me" onclick="DoPostBack()" />
</form>
</body>
</html>
I am getting the following error: Line: 13 Error: Object expected I can't understand why this error is coming.
View 2 Replies
Jun 9, 2010
I have a website on visual studio 2008 on my local machine. When I run through the debugger I get the following error, however when I browse the same website through the IIS manager (running IIS7.5), I can browse it. What do I need to fix to run it through debugger? The website is set as an application.
Error:
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately.
[Code]....
View 2 Replies