Validating Text boxes and drop down lists - c#

I am currently working on a visual studio asp.net website and have a web aspx page with textboxes drop down lists, and a submit button at the bottom of the page. I want the submit button to not function unless all the text boxes are filled and a selection from the drop down menu is made...how can i do this the easiest way possible? I have tried using required field validators and done research still cant seem to achieve this... any help would be great!

I would use for textbox validation Angular and JavaScript which you could integrate with your ASP.NET project. With angular you can use ng-disabled to disabled a button it's very easy.

Related

Trigger for tabcontainer asp.net webform

I have a ajax tabcontainer (web-forms not MVC) with different tabs and i have a radio-button list on one of them and when I click on it a value on a different tab needs to change.
Whats the best approach for a trigger here?

Get user-highlighted text from a textbox in C# web

I have a web app in which I want to be able to highlight a word or two in a multi-line textbox, out of several paragraphs of text, and have a button click method manipulate the selected text.
I want to be able to store the selected text in a variable but I haven't been able to find a way to get highlighted text in System.Web.
I know that System.Windows textboxes have the SelectedText property which would be perfect, but unfortunately I don't know how to use anything but the asp.net framework with html pages and c# code behind.
Basically what I am after is an equivalent of TextBox.SelectedText that I can use in a web app, or an alternate route which will accomplish the same result.
The user will be writing the content into the textbox so suggested different controls need to be editable.
I have tried incorporating Javascript into my C# code but it proved too complicated for me, and I don't know how to create a solely javascript web app.
Thank you for your answers so far

How to Drag and Drop selected items from a list box to Textbox in Asp.net?

I'm stuck trying to find a solution for my requirement.I know this is possible in windows application but no idea about web application.So Can anyone tell me how to drag and drop to a text box in asp.net web application ?
What i need in my web application is, I have a list box and i want user select single or multiple items and drag it from this list box and drop those items to a text box in Asp.net.so how can i do it in asp.net.
Thanks in advance.
UPDATE
According to this StackOverflow article, it is not possible to do it with the traditional html <select> (ASP.NET ListBox generates a <select> box).
However, you can do similar functionality with <ul><li>, radio buttons.
See this stackoverflow question for reference on to do it using <ul><li> items.
ORIGINAL
You can use a javascript library called jQuery (and more specifically to the jQueryUI library) to add this functionality to your ASP.NET pages.
Link to jQueryUI
Link to jQuery Droppable
Link to jQuery Draggable
Here is another stackoverflow question about drag and drop with a textbox. You will have to do some work on your own to get the exact functionality you need, but I'm sure you can find many examples online.

Textbox for page number

I just started learning asp.net, I want to put a textbox in my gridview control to let the user input whichever page the user wanna go instead of click First/Prev/Next/Last buttons.
Within the gridview control pagersetting mode, I can't find an option to create this kind of function. Is there a way to do this in ASP.net?
Start Visual Studio -> File -> New Project -> Web -> ASP.NET Dynamic Data Entities WebApplication
In solution explorer expand Dynamic Data -> Content folder
There is an awesome user control called GridViewPager.ascx:
Add it to your project and specify it as the PagerTemplate in the GridView:
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
You may need to tweak the user control slightly to work for your specific project but this should give you a good start
Its called paging. This will show you how to implement paging. I know its not ASP.NET but the C# code the methods are the same. As they explain you need to use a data adapter to create the pages the viewer will see.
Hope this helps you!

ASP.NET Wizard Control inline editing

I have being developing a form with the wizard control. The final step is a summary of the content that has been entered by the user as a confirmation step before submit the form.
These summary sections also catgorised into visual sections that corresponds with the each WizardSteps.
Each summary section is provided with an edit button that should allow user to edit the content then and there and update the content.
However the form should work without javascript so no use of AJAX. I'm not sure how this can be achieved? Is there a way to assign corresponding WizardStep to a placeholder onClick of the "EDIT" button for that summary section or is there any other way to do this?
Personally i would not bother trying to create a website in asp.net were one specification was that it should have to work without javascript. It is possible but your options are very limited. Here is a list of controls that don't work without javascript. I'm afraid wizard is one of them. If you must not use javascript you are going to have to create your own control that mimics what the wizard does but without JS.

Categories