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

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

setting dropdownlist item in page load

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

 I can't get the following to set on page load.  I want the month selected be the current month, on page load.  What needs to change here?

DropDownListCCExpMo.SelectedItem.Selected = Date.Today.Month


View Complete Post

More Related Resource Links

Load GridView at Page with corresponding Item ID



I have a GridView that I would like to load at a specific page that has an item with same ID as the QueryString parameter in the URL.

Is this possible? If so can anyone give me some pointers?

I can post code if needed.


Ashley Perolls

Setting the default start page in godaddy hosting?


 How do you set the start page with godaddy hosting? I can see no way of doing this! You do not seem to have access to the IIS settings that allow you to change it!

Open ModalPopup dialog on page load


Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?

JQuery Treeview plugin is not working with Ajax page load in ie8


Hi there,

I developed a page where i m using jquery treeview plugin to generate tree. It worked fine on FF, IE8 with out ajax.

But when my page loads thro' ajax call in IE8, it is not collapsing or expanding tree.

Any idea?

Thanks in advance.

Slow page load during a list query one time during the day


We have a monitoring tool set to check to see if the home pages for our 3 web apps load in under 60 seconds every 10 minutes.  All 3 web apps load in under 3 seconds on every 10 minute check except for one exception.  One check every day one of the web app's home page takes longer than 60 seconds to load.  This happens at 11:45PM when there is very little user usage on the environment.  The characteristics of this page are as follows: The only thing on the page is a list view web part which was added by the browser.  The page has not been customized with SPD or code at all.  The list that it pulls is a simple links list that has 281 items on it.  The view pulls all 281 items and displays them in sets of 100.  I cannot find any associated event in the server events and/or SharePoint ULS logs nor are there any daily sharepoint timer jobs running at that time.  Our full index happens at midnight with incremental happening hourly.  Our enviroment is 2 WFEs, 1 App/indexer and we have a separate SQL cluster backend.  

Could someone lead me possibly in the direction I should take next in my troubleshooting?   

external content not load in page like style and js in asp.net mvc when i use area


i am working on a asp.net mvc 2 website who have a area and i have a problem with them.

i use different different url routing for application settings. i have two folder called style

first folder location in main directory  /Style/style.css

second folder location in Area area/style/style.css

everything is work fine in application but when i used style.css from main directory in my area's views then style not worked. when i track them from firebug then i got error "The resource could not be found" but path is correct.

sombody tell me to use absolute path to solve this issue. how i can use absolute path to declare resource url in views.

any suggestion , sollution on this issue who can help me to solve this issue.

page load timeouts and http 500 on MOSS2007


Hi All

I'm hoping someone can point me in the right direction re troubleshooting. We have a MOSS server farm - 3 WFE 1 APP 1 SQL cluster. All Server 2008 sp1 x64. We see occasional http timeouts (HttpException (0x80004005): Request timed out) with associated http 500 error. I have enabled failed request tracing and can see the following:

SiteId 754431215
AppPoolId SharePoint - intranet.*********.com80
ConnId 1610966466
RawConnId 0
RequestURL http://intranet.*********.com:80/Pages/default.aspx
RequestVerb GET

and then later in the trace:

ModuleName IsapiModule
Notification 128
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode 0
ErrorCode The operation completed successfully. (0x0)

The problem happens on other pages too but the rest of the time the page is returned in less than 5 seconds. The server app logs and sharepoint ULS logs do not give any more detailed info. What I want to know is what other troubleshooting step can I take for http500 errors.

In the past on 32bit environments I have used de

Pop Up window on the load of the page in MVC



        I need an urgent help, when the page is loaded in the explorer, my code will hit the DB and if it fetches a record then I have to throw a pop up window when it loads the page. 

I have no idea on implementing this MVC. 

Can anyone help with this.

Kindly reply ASAP.


DropDownList problems : The ViewData item that has the key 'userTYPE_id_user_type' is of type 'Sy

Hello,I've been searching for that problem for hours...I have two table :          -user          -userTypeI'm trying to create a user, wich as a column id_userType, so I'm trying to do a dropdownlist with the userType List I've that error code : The ViewData item that has the key 'userTYPE_id_user_type' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'. // // GET: /User/Create public ActionResult Create() { //Send to the view, the userTypeList IEnumerable<SelectListItem> userTypeList = new SelectList(_userRepository.FindAllUserType().Distinct().ToList(), "id_user_type", "Description"); ViewData["userType_id_user_type"] = userTypeList; return View(); } here the post controller // // POST: /User/Create [HttpPost] public ActionResult Create(users user) { if (ModelState.IsValid) { try { _userRepository.addUser(user); _userRepository.save(); return RedirectToAction("Index"); } catch { return Vie

How to avoid viewstate in page load event??

Hello Everyone, Here Is my scenario,I haveMaster Page -> ASPX page -> User ControlUser control page is contains all dynamic bind controls (e.g Repeater) depended on ASPX Page (Only one parameter say ItemNo) The problem is, if I bound user control on page load event with passing respective parameters then it's create to much view state (I checked source file and it's almost 1.5 MB) In other way if I put one textbox, and a command button and I pass required parameter on button click and load the control then page size is ok (I checked and it's  < 500KB) So is it any way I can reduce my page/state size??

Updating a List item field value in a SPD Workflow is setting Date fields to null

Hello everybody,I faced a very weird behavior while creating a workflow in SPD against a Document Library.Here is the case:1- Create a document library in sharepoint site.2- Add a custom column of type DATE.3- Upload any document to the library4- Edit the item metadata and set the custom date field to any date you want.5- Now using sharepoint designer, create a very simple Workflow with only one action that updates the current item "Title" field to any value. (Note: In my case I set the workflow to start manually and not automatically)6- Save the workflow and then start it on the uploaded item.7- Now check the value of the date column after the workflow is finished.8- You will see that the Date field is Empty... (very weird)Notes:   1-This behavior will not appear on a standard list. it is only appearing in a Document library.  2- I am using WSS 3.0 SP2 + MOSS 2007 SP2. Also SharePoint designer 2007 SP2Did anyone face this situation and does it have a fix, or am I doing something wrong here... Please help.Regards,Maheed

Adding a list item that populates a particular part of a page

I am trying to create a list view in sharepoint designer that when you enter a list value it populates the right part of the page. Background - I am creating a list for a marketing newsletter that when you fill out the list form it will populate the marketing newsletter on page. its to save recreating it every month. the list has drop downs for addition and department and the data is inserted on the page. thanksSharepoint Customiser

Load content to the page with in XML?

I'd like to find out about the best technique to generate multiple container boxes/thumbnails of the content with xml that are loaded into wrap panel. It can be stackpanels or listboxes with textblocks and checkboxes in them. Any sample or helpful source of information is highly appreciated. Thank you in advance.

Is there a function in Jquery which run only one time no matter load page or PostBack

In asp.net, I can use Method A to run somethings A one time, and somethings A will nor run when page is postback but In JQuery, I hope to run something B one time when the page is loaded, but if I use Method B, the "Somethings B" always run even the page is pastBack, how can I do? Thanks! ------------------Method A------------protected void Page_Load(object sender, EventArgs e){    if (!IsPostBack)    {       //Do Somethings A    } }   ------------------Method B------------$(document).ready(function () {   //Do Somethings B})

The site master page setting currently applied to this site is invalid. Please select a new master p

I have defined a new master page and set it as default for the main site.  Any time I create a new subsite it does not apply the new master page and defaults back to the default.master.  The Site Master Page Settings shows this error. The site master page setting currently applied to this site is invalid. Please select a new master page and apply it The system master page setting currently applied to this site is invalid. Please select a new master page and apply it. Now if I select "Inherit site master page from parent of this site" and "Inherit system master page" and click ok the site will use the new master page and everything is fine.  There is only one modification to the master page that was done so I know the master page isn't invalid.  Does anyone know the answer other than recreating the new master page.

Create buttons for "new item" which create a new page of a specific content type

We have a Pages library (wiki) which supports a few content types (and page layout associated). We want to enable users to click a button for example of "new custom enterprise wiki page" - so a new page of content type article will be open in edit mode. Can someone help how to develop? (it has to mimic the behavior that happens when user creates new page from the Ribbon or Site actions and has to choose the content type, it also has to keep the new page in edit mode and not just create it).  

Open lightbox on page load

Hi,please see below code for open lightbox<div id="dialog2"></div><a name="ancBook" href="#dialog2" >Test</a>on click on "Test" link a lightbox open. Now I want the same thing on page load depend on my condition that I am checking on page load.this lightbox open using JQuery.RegardsReetesh
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