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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Dropdownlist posted back html content,firefox alarms "Invalid postback or callback argument"

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

Ok probably you might have seem a dozens of post's titled "Invalid postback or callback argument" but this one is different.

Application that i am creating is simple content editor using the FCK editor.net Control (the content is HTML Encoded before saving t0 DB and then Decoded back again when displaying). just a simple drawing of of its ui is like this

DdlPages < listing the pages Whose regions/controls value can be edited> Databound

DdlRegions <listing the controls whose content can be edited> Databound on DdlPages selected index change

===========Retreived from DropDownlistRegions selected Index Change===========

txtName <a simple name for the region, user friedly identity >

==> FCK Editor <==

<Save Button> <Discard Button>


I am not such a good designer but hope you understand the UI layout.

This thing works flawless on IE 6,7,8


DropdownlistRegions holds the content to be displayed in the txtName and FckEditor. This is done by forming a custom concatenated column containing the txtName and Fckeditor(HTML content) separated by a ' ^ ' character. and then databound the column to the Dropdownlist value property.

So on selected index chang

View Complete Post

More Related Resource Links

Model Binding the values in an HTML Table back to Controller / Model


Currently, I am working with ASP.NET MVC1 and am still learning about Model Binding and how values from a View are passed back to the Controller / Model. Specifically, I want take an existing Model, create a Table and populate the Rows of the Table, allow the user to edit some fields and pass it back.

In my example, I have a Class called "Ingredient" which has 4 public accessors:  Name, Barcode, Amount, and Unit

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcACE.DomainModel.Entities.Ingredient>>" %>

<% using (Html.BeginForm("SubmitOrder","MyController"))
{ %>

<% if (Model != null)
foreach (var item in Model)
{ %>
<td><%= Html.Encode(item.Name)%></td>
<td><%= Html.Encode(item.Barcode)%></

Rendering Partial view postback with data posted back and entire view context

This is the base Index.aspx view:<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <%@ Import Namespace="LMWebUI.Components" %> <%@ Import Namespace="LMWebUI.Models" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <% Session["HasScripts"] = "false"; %> <% if (Utility.FixNull(Session["LoggedIn"],"false") == "false" ) {%> <% ViewData["Login"] = new PartialRequest ( new { controller = "Account", action = "LogIn" } ); ((PartialRequest)ViewData["Login"]).Invoke(ViewContext); %> <%} else {%> <div>Logged In Content here</div> <%}%> <script type="text/javascript"> LMx.init(); </script> </asp:Content> This is a helper class> that I found elsewhere, doesn't solve the problem, but still works to display the viewpublic class PartialRequest { public RouteValueDictionary RouteValues { get; private set; } public PartialRequest(object routeValues

How do I turn off HTML validation in the Content Editor Web Part?

I'm fairly used to SharePoint 2007, where I could inject pretty much whatever I wanted into the CEWP, and among other things affect the page style or create div-based layouts. However, in SharePoint 2010, inserting code into the CEWP seems to go through a HTML validation process, which inserts and converts the original HTML code and ends up in incorrect results. How can I turn off this HTML validation stuff, or alternatively, is there any other way for me to inject HTML into a web part as I wish?

Html.DropDownList using a List

This has to be a simple thing, but for whatever reason, I'm just not finding it. I want to use the HTML Helper function to create a DropDownList based on a List<string> (and actually have it bind to the data field on the model).  The simplest example, I suppose, would be: <%: Html.DropDownList("Material", new SelectList(new[] {"Wood","Brick","Metal"})) %> This creates the items in the drop-down, but of course, there's nothing in this line that would bind it to my model (model.Material).  I've done drop-downs with collections of models, where you can bind the Data and Display attributes to properties of the class, but I don't have a class here, just a List. Any ideas?

Reading WPF rich text box content in HTML format

Hi, I am using WPF RichTextBox. From that, I am reading the content in RTF format using the following code. TextRange textRange = new TextRange(paramRichTextBox.Document.ContentStart, paramRichTextBox.Document.ContentEnd); MemoryStream msData = new MemoryStream(); textRange.Save(msData, DataFormats.Rtf); //get the data from the selected range //strData = textRange.Text; strData = ASCIIEncoding.Default.GetString(msData.ToArray()); I also found that there is an option called DataFormats.HTML. Hence, I tried using this but ended up with error. Is there any other way to read the content of RichTextBox in HTML format? Thanks in Advance!!! Best Regards, Subalakshmi Vijayarajan.

Flash Content missing in firefox redirected

Hi,    Do not know if anyone has encountered this problem? Not familiar with Flash. Here's the situation. We have a public client site with Flash content (uses url rewriting) say "\malls"  but at server side it is something like Default.aspx?page_id=456. Now since this site comprises of several sub sites like malls, which has existing public url like www.mymalls.com which is redirected to www.mysite.com\malls no problem with other contents (all displayed ok except for the flash content). but when you click another within www.mymalls.com say going to www.mysite.com\mall2 the flash content is displayed ok (not missing). Can anyone show me where to look or how to fix this? Thanks.    

determining if there is content in a ContentPlaceHolder when using Html.RenderPartial

What I'm trying to do is use one master page with two different layouts.  Currently we have a "master" master page that has all the common elements and two master pages that use it for the two different layouts.  This gives us 3 master pages and there's developer confustion and it is a bit of a hassle to keep them consistent.  What I'd like to do instead is say "if there's anything in the MainContent ContentPlaceHolder, show the single column layout, otherwise show the two column layout".From what I've read you're supposed to be able to do this by using something like the following:<% if (this.MainContent.Controls.Count > 0) //single column layout { %> <div class="center-column-middle clearfix"> <!--.form-holder--> <div class="form-holder"> <asp:ContentPlaceHolder ID="MainContent" runat="server" /> </div> <!--/.form-holder--> </div> <% } %> But this.MainContent.Controls.Count retuns zero when the ContentPlaceHolder uses Html.RenderPartial.  For example, this works fine:<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> blah blah blah </asp:Content> This causes this.MainContent.Controls.Count to return 1.  If I rem

HTML Content into Text


Hey all,


is it possible to convert html into text in a field?

I've got e-mails in my report where it is html and I would need to print and display it without html.




Get the value of hiddenField HTML control not work properly in FireFox


Hi Guys,

I'm trying to access the the value of Hidden field as follows:

var empID= document.getElementById('HiddenField1').value;

It works well in IE but gives null in FireFox

ASP.NET AJAX Post back happening in IE7 but works good in Firefox


Hi all,

I am debugging one of the project which is implemented using .Net Framework 3.5.

in the home page the project has 5 widgets.

In one of the widget contains a two radio buttons and a save button.When ever the user tries to change the Radiobutton option and Save the results will be displayed properly in Firefox.

But in Internet Explorer 7 the page gets a post back and all the widgets will be reloaded and finally the default radio button will be selected as default instead of the option which i selected.

Can any one help me to resolve this issue.

thanks in advance

Html.DropDownList items with '<'


 How do I tell asp.net to display escape characters in a 



In the select list, there are some '>' and '<'. I used &lt; and &gt; but the page shows &lt; and &gt; instead of '<' and '>'.

Any help?


How to use AJAX editor with HTML content?


I have a AJAX editor and I want to put the HTML content in a database and I want to get the HTML data from the database to put in the HTML editor, in HTML mode.

So I do:

Editor1.ActiveMode = AjaxControlToolkit.HTMLEditor.ActiveModeType.Html;
        Editor1.Content = MessageLabel2;

Editor1.ActiveMode = AjaxControlToolkit.HTMLEditor.ActiveModeType.Html;

Editor1.Content = data_from_database;

But what happens is that I get the HTML data from the database in designmode in the editor, so I have HTML in designmode and HTML to HTML in HTMLmode (and that is not what I want of course).

Of course I want only HTML in HTML mode and in designmode I want the normal text.

How can you do this and is this possible?

WPF- Back/Forward navigation UI not working when Html web files are displayed in Frame Control


I am integrating (web) html files in my WPF application using Frame (say Source=http://www.microsoft.com)

I set the JournalOwnership="OwnsJournal" and


The navigation UI is visible and disabled initially when the page loads up (which is fine), but when I click on links the Back/Forward button is not enabled.  Interestingly the context menu shows Back/Forward and I can navigate that way. Do you have pointers?


Thanks for your help.

FileUpload content after post back


Hello all. I have many file upload controls in my web page. In this page is a add button that create dynamic controls in table rows. Every table row has a file upload control. When this button clicks, post back occurs and all file upload controls content fly and user have to select all of them. What should I do for keep FileUpload content after post back?

WCF returning "The content type text/html of the response message does not match the content type of

I have a WCF service I am trying to run on a new installation of 64-bit Windows Server 2008 IIS. Although it runs fine on Windows 2003 IIS, it is throwing the error in the thread title, which appears to be a server config issue, but I am not sure. Googling and searching the MSDN forums did not turn up a solution. I tried running WCF Logging, but that didn't help either.

Does anyone have any suggestions on how to solve this probelm?

Here is the error:

The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content=&qu

What is the best way to upload html content?


I am looking for a solution that can help my SharePoint contributors to be able to more easily create linked pages in SharePoint 2007.  They need to be able to upload about 7 files at a time, the first one being the TOC (table of contents) and the rest being the links from the TOC.  Thing is really cumbersome to do using the native web interface because they cannot "browse to" the subsequent pages when inserting a hyperlink.  In essence, they need to know the URL and this is really hard for them.

I would love to have something simple like FrontPage.  Something that allows them to simply create an HTML page and link to the rest by dragging the other pages into the body of the page you want the link to be in.  We have researched SharePoint Designer, but that does not seem to cut it.  SharePoint Designer seems to be more of an admin/management too

Beginner question: get selected value of Html.DropDownList


Hi everyone, how are you doing!

I'm just started learning MVC 2. I went through the music store example (though I don't 100% get everything). Now I want to add some functions to the page to learn more. I added paging, and now I want to add search combo boxes (drop down lists). Basically, in the album list screen, I want to add 1 drop down list of genre. If user select 1 genre then click Search, the page should show all album of that genre only.

My problem is I don't know how to get the selected value of this drop down list. The approach I am using now is to get the selected value, then put it as parameter and redirect to Index (/StoreManager/Index?searchGerneId=x). I searched through many posts but couldn't find a solution that works for me. It is probably because I don't really get MVC yet and still try to do things the code-behind way. So please help me :) My code  for Index in Controller is below

public ActionResult Index(int pageNumber = 1, int searchGenreId = -1)
            var albums = from album in storeDB.Albums
                         join genre in storeDB.Genres on album.GenreId equals genre.GenreId
                         join artist in storeDB.Artists on album.ArtistId equals artist.ArtistId
                         orderby album.Title
                         select al
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