.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

PRECISE RichTextBox Selection (AutoWordSelection appears to be stuck on True)

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :.NET Framework

I am using a RichTextBox to display some data in hexadecimal format   I want to be able to select exactly the bytes I want but AutoWordSelection is getting in the way.  I did find nobugz's post in a thread named "Stop RichTextBox from overselecting" and thus learned about AutoWordSelection.  But his post and the doc say that it can be set to False.  But the False setting seems to be ignored.

Is there any solution to this.  It's really annoying! 

Thanks,  Bob



View Complete Post

More Related Resource Links

PRECISE RichTextBox Selection (AutoWordSelection appears to be stuck on True)


I am using a RichTextBox to display some data in hexadecimal format   I want to be able to select exactly the bytes I want but AutoWordSelection is getting in the way.  I did find nobugz's post in a thread named "Stop RichTextBox from overselecting" and thus learned about AutoWordSelection.  But his post and the doc say that it can be set to False.  But the False setting seems to be ignored.

Is there any solution to this.  It's really annoying! 

Thanks,  Bob



Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

ASP.NET Multiple Selection DropDownList with AJAX HoverMenuExtender

Recently, I was looking for a multiple selection dropdownlist control for my new project. After spending some time researching for it, I decided to put together all my finding in one web user control. This web user control consists of an ASP.NET AJAX HoverMenuExtender, JavaScript, StyleSheet and CheckBoxListExCtrl . The final product will work with or without a MasterPage and you can drag and drop more than one instances of the control on to the page.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

validateRequest appears to be kicking in in MVC RC1 despite settings

After upgrading a project to the RC a System.Web.HttpRequestValidationException is thrown when posting a value containing HTML from a TextArea. I have checked that validateRequest=false in Views/web.config, and have set this in the application's root web.config. I have also created a fresh MVC project, created a simple view & controller and posted a simple html paragraph element with the same result. Call stack provided. [HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (html="

hello world

").] System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +8718538 System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +111 System.Web.HttpRequest.get_Form() +129 System.Web.HttpRequestWrapper.get_Form() +11 System.Web.Mvc.ValueProviderDictionary.PopulateDictionary() +113 System.Web.Mvc.ValueProviderDictionary..ctor(ControllerContext controllerContext) +74 System.Web.Mvc.ControllerBase.get_ValueProvider() +31 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +53 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +109 System.W

Genetic Algorithms: Survival of the Fittest: Natural Selection with Windows Forms


Genetic Programming is an evolutionary algorithm that employs reproduction and natural selection to breed better and better executable computer programs. It can create programs that implement subtle, non-intuitive solutions to complex problems. By taking a well-known example from the Genetic Programming community and implementing it with the .NET Framework, this article demonstrates that CodeDOM and Reflection provide all the facilities that are needed to do Genetic Programming effectively.

Brian Connolly

MSDN Magazine August 2004

FormView KeepInEditMode=true isn't retaining values


I have an "Edit Page" in my application. It uses a FormView bound to an EntityDataSource.

I have a handler setup for the FormView OnItemUpdated event. If an exception occurs (such as foreign key constraints or non date vales entered in a date colum, etc.), then I set the "KeepInEditMode=true". This is SUPPOSED to retain the user entered values on all of the text boxes instead of rebinding the FormView to the data again and clearing those text boxes. (Right?)

Well, it isn't working...

I have stepped through the code via the debugger and the "KeepInEditMode" does get set to true, but as soon as the page reloads, the values revert back to the original database values (the data is being rebound).

I should also mention that I am setting "ExceptionHandled" to true. I am doing this because I am handling the Exception by displaying an error in a specific area of the page and if I dont mark it as handled, IE generates an Exception popup.

Any ideas?

Checkbox will show panel based on selection without postback.. how to do



I have Two Checkbox in my asp.net textbox..

First what i want is

based on two checkbox user has to be select any one only..

if checkbox1 is selected then Panel1 visible true without postback

if checkbox2 is selected then Panel2 visible true without postback

Error "user does not have permission to perform this operation" with User Instance = True.


I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005.

I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True.

The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False.

I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working.

Appreciate your help.


(Imperfect) Solution to TreeView Postback / Client-Side Node Selection Issue


I've seen this question posted on all corners of the web... "How do I disable "AutoPostBack" on the ASP.NET 2.0 TreeView control?!"  Unfortunately, most of the answers either don't work, miss the point (don't work right), or boil down to "You can't do it."  I happen to know that this behavior worked perfectly in the IEWebControls TreeView that Microsoft released as an add-on prior to ASP.NET 2.0, however.  So I set out to find a solution for the ASP.NET 2.0 TreeView issue.

In a nutshell, the behavior that I and others are looking for is to have a TreeView rendered in a page that allows the user to expand, contract, and select nodes within the TreeView without causing a PostBack to the server.  This implies two things: (1) the most recently-selected node should be recorded as the currently-selected node [i.e., at PostBack time, the most-recently selected node is actually represented as the SelectedNode]; and (2) the selected node should exhibit the SelectedNodeStyle as specified in the TreeView declaration.

It appears that the TreeView engineers saw only two possible outcomes from selecting a leaf node in a tree: (1) immediately posting back to the server, or (2) immediately navigating to another web page.  They apparently did not consider option (3) just allowing selection in-place on the client, while waiting for a click on so

How To Access Datakeys In Javascript...and How To make gridview Column Visible true in javascript


How To Access Gridview's Datakeys In Javascript...and How To make gridview Column Visible true in javascript

Reply me..

infopath form stuck with installing or deleting



I am deploying an infopath form in central admin and it stuck with the message "installing" and if i try to remove it stuck with message 'deleting". I restarted timer as well admin jobs in all servers (front end and app) but it is still showing the same. I also renamed my form and tried..no result. Can any one suggest me how to resolve this? I am wondering how it s happening just from one week.there are no changes in servers as well in environment. It works well before.



image sometimes appears, sometimes does not


is a strange problem am experiencing. have a asp.net 2.0 application then creates bitmaps using GDI+ and then copies them onto hard drive as bitmap files and then web page is updated with URL pointing to the bitmap. using a "dummy query string parameter" to trick the browser into knowing its new images to prevent caching problem where old images are displayed.

the web page can have up to 20-25 bitmap images, but sometimes one of them is missing-- doesn't matter if its long page or short page. when right-clicking on the area and then selecting "properties" it suddenly appears.

has  anyone experienced anything like this ? and/or anyone have any idea how to solve this problem?

was thinking of somehow refreshing programmatically? but don't know how to do that.

using Internet Explorer (a requirement).

thanks so much.

Dropdownlist appears to be null in code behind


I have a weird problem...

I have a web part form, with one of the dropdownlist, when referenced in code behind, happes to be null.

Common.bindMultiChoices(ddlPly4, oEnquiriesList, "Ply 4 Type (Paper)", "Select Ply 4", null); 

But at front user control file, I do have:

<tr><td><asp:DropDownList ID="ddlPly4" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPly4_OnSelectedIndexChanged" /&
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