Master page post back on click of sub-menu item - c#

I have a master page where in I have menu list items are :- Add Staff, Add Venue,Add Time Sheet , Setting , Invoicing. Sub Menu Items of Settings are :- General Settings , Users , Roles , Sub-Contractors. my concern is When I click on General Setting , Users my entire page gets post back. I do not want this to happen. Instead I want only the content that needs to be refreshed/change.and my second concern is :- all Sub-Menu items of settings shown on all setting page as i go from General Setting to Users how is it happen.
Any quick / easy solution to the above issue?
Please help.

You have two choices:
Use ASP.NET tags to use Ajax to change the tabs asynchronously.
(Better) Use a javascript framework like JQuery or Dojo to create the effect in javascript. (Note that Microsoft is including JQuery in newer web templates)

Related

Manage state in MVC4

I have a page with around 20+ controls. Within this page I have a partial View which I am using to create an editable grid. This grid has Add New Row/Remove Row buttons on click of which data entered in the textboxes in grid row gets added to the grid.
Whenever I click these 2 buttons, my page is getting refreshed due to which whatever data is being entered by the user in the 20+ controls of main page is lost.
I have tried hopelessly searching for solutions quite some time, but still trying my luck out here. Any ideas are appreciated.
Well I recommend you to use full jquery mechanisms to add or remove rows. You can easily add or remove HTML elements. All you have to care about is to maintain the numbering system. I suggest you to use a view model that contains a list of objects that you need to add or remove. At first render it normally by providing list of objects (from database or other source, if required). After this define your add and remove buttons to type button and play with jquery to add remove table rows or even divs. After adding or removing required element, reorganize your numbering. At submit you can use either full postback or ajax postback. If Any confusion, let me know.

Keep a dropdown list highlighted after a post back in .net aspx page

I have 7 dropdown lists within my page , following a post back from dropdown list 1 I want this to still be highlighted when the page reloads so that I have the ability to tab to the next dropdown list
I have tried smart navigation but this did not work. I'm using framework 3
Any guidance would be appreciated
Thanks
You can use the focus() method
For example in code-behind:
DropDownList1.Focus();
This will give focus to DropDownList1
Alternatively you can use
Page.SetFocus("IdOfControl");
You will need to store the ID of the control in either a session or querystring so you can access it after postback so you know which control to give focus to.

asp.net: combobox or listbox PLUS checkbox

i need a solution like this:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx
however, i need the user to be able to add entries in here.
does such a control already exist?
it can be either jquery or asp.net
it also does not have to be a combobox, it can be a listbox. i need to have every item have a checkbox next to it and be able to add a comment for each entry.
Take a look at the ASPxGridLookup control from the DevExpress component vendor.
The ASPxGridLookup component allows the implementation of the multi-select DropDown functionality:
http://demos.devexpress.com/ASPxGridViewDemos/ASPxGridLookup/MultiSelect.aspx
http://www.devexpress.com/example=E3467
http://codecentral.devexpress.com/E3467/
with editing capabilities via the embedded ASPxGridView object:
http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/EditModes.aspx
Ref : DropdownList with Multi select option?
Multiple dropdownlist with checkbox....checkout below link...
checkout demo page here...
http://download.ysatech.com/ASP-NET-Multiple-Selection-DropDownList/ASP-NET-Multiple-Selection-DropDownList.aspx
Blog page here....
http://blog.ysatech.com/post/2009/09/09/ASP-NET-Multiple-Selection-DropDownList-with-AJAX-HoverMenuExtender.aspx
http://www.codeproject.com/KB/user-controls/MultiSelectDropdownList.aspx
To me it sounds like it might be better for you to run with a ListBox. Telerik offers the RadListBox, which allows you to have checkboxes as seen here.
Additionally, you could allow for edits upon, for example, double-click as is displayed in the source code attached to this forum post.
Finally, if you want to also display the comments then you could use an ItemTemplate to define a custom layout for each RadListBoxItem and allow the user to edit both the main and comment fields.
That should cover everything that you need.

How to bring up new window for each selection from checkbox list in ASP.NET?

I'm new, building a practice project in C# and ASP.NET. Have a checkbox list with 7 insurance products; when a user selects a product, I need to bring up a new window where they can customize this product. What is the simplest way to do this?
To open a new window, you need client-side javascript (window.open).
EDIT
in response to the submit of the list, generate some script statements (see RegisterStartupScript).
But are you really sure that this is what you want: open a handful of new windows?
A different approach would be to remember that list server-side (in Session) and handle those products one-by-one.
EDIT
You could have a redirect page: as long as there are items in the list, take&remove the first one and show the page for that. When that page is finished, redirect back yo the redirect page. When the list is done, go back to the list (or whatever).

asp.net advanced search form, results in a grid and back button

I'm working on a asp.net forms web application where I've got advanced search form with grid listing results below. Grid is sortable and pageable. Grid is listing products.
I've got two requirements :
1) make the url remember the advanced search form state so search results page can be bookmarked etc.
2) on the product details page there is a back button that should take the user to the advanced search page with the same settings in the form and same grid state.
I have implemented a workaround to above two problems but I don't think my solution is very clean and I'd like to hear better ideas. My workaround is as follows :
1) I iterate through form fields and I put values into the querystring after the hash. So when the page is loaded it gets the values from url if available.
2) when user clicks a link to product details page from the grid I use javascript to create a cookie with url to advanced search page so when rendering the product details page I know the url for the back button.
I'd like to achieve above functionality in cleaner way.
Thanks,
M
You could try setting the search page form action to GET. This will put everthing in the query string for you, enabling the bookmarking and the back button.

Categories

Resources