.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

Problems with on load event.

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :SharePoint

Hi all

I am using an InfoPath template in a Library. My form has 4 views, that all switch according to the document status (draft, pending, approved, rejected). On the library the built in document approval workflow is enabled. When the document gets pending status, the approval workflow creates tasks related to the documents in a separate tasks library.  In the approved and rejected view on the form I want to show details about the tasks, and the outcome of the worfklow, inside the form.

To acheive that I created a recieve connection from the tasks library, and added it on the form as a repeating table. This will give me all tasks, and create as many rows as there are tasks. Which can be more than 100 ++. To show only the unique row, I use the document filename as an unique identifier, concatenated with "Please approve" becaue all tasks will have the title "Please approve 'filename'". Then on my repeating table on the form, I have conditional formatting that will hide the control when Title is not equal to my builded string filename. This will give me my unique row.

But, the problem is that it downloads all tasks in the form, and if i click on the rows, they will start disappearing, except the one which is my unique row. To avoid downloading all tasks, I wrote code for FormEvents_Loading.

This is my

View Complete Post

More Related Resource Links

Ajax Accordion to load data from client click event


I have a Ajax Accordion control on my page with treeview in Content Template. As the treeview for each pane are big. I am wondering whether I can load the treeview from codebehind only after the pane is selected. I can reuse the code from ItemDataBound of Accordion control.

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??

loadviestate of control created on the load() event

Why if I create a label on the load() event its properties are restored after a postback, even though it doesn't pass through the loadviestate stage? Example:Partial Class Default2 Inherits System.Web.UI.Page Protected Overrides Sub LoadViewState(ByVal savedState As Object) MyBase.LoadViewState(savedState) End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim lb As New Label Me.Controls.Add(lb) If Not Page.IsPostBack Then lb.Text = "xxxx" End If End Sub End Class <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>title</title> </head> <body> <form id="form1" runat="server"> <asp:Button ID="Button1" runat="server" Text="Button" /> </form> </body> </html>   And why everybody advice to create controls in the overrides of the method LoadViewState(), if it's ok also in the load() event

opening a web browser without opening form on windows form load event

Hello All, I have a main frame which has a display button. after clicking on display button I usually open a windows forms. Now I have a requirement to open a web page after clicking on display button. I should not show windows form to the user. for that I had written following code in the Form_int (override) event of windows form. System.Diagnostics.Process.Start(http://www.google.com); and I commented out ShowDisplay(); code.  Everything looks good till now and when I run the project and clicked on display button web browser has been opened, but if I click again another web browser is being opening. but I don't want another browser to be opened. can anybody please help me in that. Thanks in advance.

show asp.net modal popup on page load event?

 hi,   I have placed an asp.net modal popup extender on my page. it works fine when a button is target controlId but I want to show it when user enters page. so I put the below in the page load event but nothing happens (ie6) pnlModal_ModalPopupExtender.Show(); Is this the right way?   thanks  

Office.sharPoint.Server Event ID: 6482 Could not load file or Assembly


Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services
Event ID: 6483
Date:  4/16/2009
Time:  2:41:10 PM
User:  N/A
Computer: JPFS02
Application synchronization failed for Microsoft.Office.Server.Administration.UserProfileService.

Reason: Could not load file or assembly 'Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

Techinal Support Details:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
   at Microsoft.Office.Server.UserProfiles.SRPSite.SynchronizeManagedPropertyMappings()
   at Microsoft.Office.Server.UserProfiles.SRPSite._Init(ServerContext serverContext)
   at Microsoft.Office.Server.UserProfiles.SRPSite..ctor(ServerContext serverContext)
   at Microsoft.Office.Server.Administration.UserProfileApplication.get_ProfileSiteCache()
   at Microsoft.Office.Server.Administration.UserProfileApplication.Synchronize()<

Web form page load event


I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

createchildcontrols is not fired on page load event


hello frnds

i have develop a custom control as shown below

public class MyControl : System.Web.UI.WebControls.WebControl, INamingContainer


private TextBox txtData ;

protected override void CreateChildControls()
txtData = new TextBox();
txtData.ID = "txtName";



Now, i have placed this control on web page. i also have other asp.net controls like combobox, checkbox etc on this same web page as displayed below. 

<%@ Page Title="" Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" EnableViewState="true" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">
    <table cellpadding="0" cellspacing="0" width="100%">
           <td><asp:MyControl ID="CmbMyControl" runat="Server" /></td>

Now in page load ev

how can i load a window1.xaml form from click event fuction of a button

how can i load a window1.xaml form from click event fuction of a button

load window1.xaml from the click event of a button

how can i load window1.xaml from the click event of a button that I created by myaddin to outlook 2003.

Problems capturing a Click event from a button inside an asp:table


Hi, I am developing a web site to display some data that is inside a database.

To do this I've created an ASPX web page that opens a connection to a database and retrieves the desired data. After that it populates an asp:table object dynamically.

The problem is that some of the fields that are retrieved from the database are too large to be displayed on the web page, so I decided to make a popup that would be able to display just the desired field.

To do this I've added a button to the asp:table so that when the user clicks it the popup would appear with the contents of the field. However what is happening is that when the user clicks on the button, the page just gets reloaded and the Click event handler is never called.

Below is the code in which I add the button to a TableCell, and the TableCell to the TableRow collection:

// Coluna Mensagem Formatada.
celula = new TableCell();
celula.HorizontalAlign = HorizontalAlign.Center;
Button button = new Button();
button.Text = "...";
button.Click += popupHandler;


Please note that the popupHandler is a delegate to the function below. I am using it as a the Click event handler for testing purposes.

protected void abrirPopup(object sender, Even

displaying 2 alternating db records with each new page load event


I have a webpage which displays content drawn from a single record in a database table. I've been asked to change this so that the content displayed alternates between 2 records each time the page is requested by a browser (I guess this would equate to each PageLoad event).

The records to be displayed are chosen on the basis of two dates, a beginning date and and ending date, that define a time period in which the record is to be active. The table containing these records has 2 columns containing these dates (begin date is contained in "dtDisplay" and end date is "lastDisplay."

I'm not sure how to amend the existing code behind to make this happen. Here is the c# that I inherited from a developer who is no longer available. Thanks for any help:

private void getfeatured_properties()
           string today = DateTime.Now.Date.ToString();

           SqlCommand cmd = common.openDatabase();
           if (cmd.Connection.State == ConnectionState.Open)
                 string sql = "select propID from featured_properties where " +
                    "dtDisplay <= '" + today + "' and " +
                    "lastDisplay >= '" + today + "'";

how to call dropdown SelectedIndexChanged event in page load event in c#


Hi everyone,

in my web form i have a department dropdown box, in its selectedIndexChanged event i have to fill the equipment dropdown box and in equiment dropdown selectedIndexChanged i have to fill out the other textboxs.

the depratment dropdown box get its value from sqldatasource.

 <asp:DropDownList ID="dp_deptname" runat="server" DataSourceID="SqlDataSource1" DataTe

Checking Some Values In A CheckBoxList In The Page Load Event.


Hello forum,

I have a checkboxlist (cblTeamMates) with a sqldatasource (sqlTeamMates) that has 3 columns (ID, FullName and Status ).  The datavaluefield and datatextfield for cblTeamMates is "FullName" and the 2 status values possible are "Available" and "Absent".  How do I go about, in the page load event,  checking all  the names (FullName) whose Status is "Available"?

Thank you.

MouseEnter/MouseLeave Event problems


Hi all,

I have a horrid little problem with a user control. I have a grid, which consists os an image and then a stackpanel. The stackpanel then consists of x number of textblocks. Each textblock is a selectable option. What I require is that when the mouse enters the grid, a border appears around the user control to highlight it (much like the Win 7 control panel). I then want the mouseenter event on the textblocks within the stackpanel to trigger and underline each option dependant on the mouse position. Basically I want the same effect as the Category view in Windows 7 Control Panel.

the problem I'm getting is that the StackPanel filled with textblocks prevents the MouseEnter event from tiggering on the Grid. How on earth do I circumvent this problem??


Please help it's really annoying me. I've tried amending z-orders on the different controls, but all I've managed to achieve is flickering effect as the MouseLeave event fires as soon as the z-order is dropped below another control.





disable button in page load click event using javascript



i have button its  enable false in aspx page, if i click the page load  click event  then button should enable

looking forward the reply.

Event 108, Report Server (MSSQLSERVER) cannot load the TERADATA extension.


Dear All Experts,

We are new install SQL2008 enterprise version.
And then I found a Event:108 error show on application eventlog.
Type:  Error
Date:  2009/8/24
Time:  ?? 11:17:42
Event:  108
Source:  Report Server (MSSQLSERVER)
Category: Extension
User:  N/A
Computer: XXXXX
Report Server (MSSQLSERVER) cannot load the TERADATA extension.

The question is , if we don't using teradata database .
How can we avoid this error message ?

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