Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

AjaxMultiupload and UpdatePanel issues

0
0

Hi,

I have the Ajax multi-upload control and the UpdatePanel control on my ASP.Net page, the problem I am having is that when the update panel refreshes, the loading progress bar dissapear from the screen.

enter image description here

After the update panel refreshes, it loses the progress bars:

enter image description here

However, even though the progress bars are not showing, it is still uploading the files (Which is good I guess, just bad when users don't know when something is being uploaded)

<asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional" RenderMode="Inline"><Triggers><asp:PostBackTrigger ControlID="ajaxMultiUpload" /></Triggers><ContentTemplate><asp:Label ID="lblSubheader" runat="server" CssClass="GMPStandardText" Style="margin-left: 4px;" Text="Add files as needed, then click distribute."></asp:Label><br /><asp:AjaxFileUpload CssClass="cssFileUploader" ID="ajaxMultiUpload" runat="server" Width="100%" OnUploadComplete="File_Upload" ViewStateMode="Enabled" EnableTheming="True" EnableViewState="True" Enabled="True" ClientIDMode="Predictable" /><input type="checkbox" id="chkDisableRedirect" name="warning" /><asp:Label ID="Label1" runat="server" CssClass="GMPStandardText">Show warning when attempting to leave page</asp:Label><hr class="cool_hr" /><asp:Timer Interval="10000" ID="Timer1" runat="server"></asp:Timer><asp:Table CssClass="filesTable" ID="fileTablePersonal" runat="server" CellSpacing="0" CellPadding="5" Width="100%" Font-Size="10">

In the code I have the UpdatePanel, the trigger (which is what is used to stop the control from post backing?), but the uploader and progress bars are all tired into once control?

Does anyone have a solution for how I can keep the progress bars when uploading multiple files?


Full page post-back is occurring when i m clicking on LinkButtons which are creating at runtime inside the panel1 with update panel

0
0

My aspx code is:-(LinkButton is generating in panel1 inside table)

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<div align="center" >

<asp:UpdatePanel ID="Udate1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%" height="40px" >
<tr><td>
<asp:Label ID="lblTime" runat="server" Text="" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Large" ForeColor="#e08846" />

<asp:Timer ID="timerFinish" runat="server" Interval="1000" OnTick="timerFinish_Tick">
</asp:Timer>


</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="up2" runat="server">
<ContentTemplate>
<table width="100%" cellpadding="9px" cellspacing="9px" >
<tr><td width="5%" rowspan="3"></td>

<td style="border: 1px solid black" align="left" width="65%">
<table>
<tr>
<td align="left">
<u> Question: </u>
</td>

<td align="right">

<asp:Timer ID="perQuestionTime" runat="server" Interval="1000" OnTick="perQuestionTime_Tick"></asp:Timer> 


<asp:Label ID="lblperqestiontime" runat="server" Text="" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Large" ForeColor="#e08846" />
</td>
</tr>
<tr>
<td colspan="2" width="70%" align="left">
<asp:Label ID="txtQuestions" CssClass="AllLabel" Width="580px" runat="server" Text="Label" Height="50px"></asp:Label><br />
<br />
<br />
<hr />
</td>
</tr>
<tr><td colspan="2" align="left"><u>Answer:</u> <br /><br /></td></tr>
<tr>
<td colspan="2" align="left">
<asp:RadioButton ID="Opt1" runat="server" GroupName="examOpt" />
<br /><br />
<asp:RadioButton ID="Opt2" runat="server" GroupName="examOpt" />
<br /><br />
<asp:RadioButton ID="Opt3" runat="server" GroupName="examOpt" />
<br /><br />
<asp:RadioButton ID="Opt4" runat="server" GroupName="examOpt" />
</td></tr>
</table>

</td>
<td valign="top" align="center" width="20%"><b>Choose Question:</b><br /> <br />
<asp:Panel ID="panel1" runat="server" BorderWidth="2px" BorderStyle="Solid" style="padding-right:10px">-------------------------------------------in this panel i m generatin linkbuttons rendomly at run time
</asp:Panel>
</td>
<td width="3%" rowspan="3"></td>
</tr>
</table>

<div align="left" >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnPrev" runat="server" Text="Previous" OnClick="btnPrev_Click" CssClass="AllButton" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" CssClass="AllButton" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnSkip" runat="server" Text="Skip" OnClick="btnSkip_Click" CssClass="AllButton" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnclear" runat="server" Text="Clear Option" OnClick="btnclear_Click"
CssClass="AllButton" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnFinish" runat="server" Text="Finish" OnClick="btnFinish_Click"
CssClass="AllButton" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</form>

please give suggestion me where im going wrong....

Client side memory leak

0
0

Hi,

I have currently the problem that a lot of my users have problems with the memory usage of their IE when they use my application. After a lot of samples and some research on google I didn't find a solution for my problem.

I hope anyone of you can help me.

About the application: *Grid = DataGrid
I just have a simple grid with a lot of columns and few rows (about 50). The grid is within a updatepanel and that causes the problems I guess. Currently I have a sample which shows the problem really well. Of course it is not a really useful sample but it helps to reproduce the problem.
It can be downloaded from my onedrive: https://onedrive.live.com/redir?resid=42A470EDA779AD47%21111
Just page the grid about 10 times and you will see that the memory increases. In the sample project its about 80%-100% on IE11 Win8.1. Many of my users have IE9 where it is much worse (feedback of the users).

Hopefully anyone knows what I'm doing wrong. Btw. using less columns or less data is at the moment no solution.

Greets,
Jochen

PageMethodes is not always called after upgraded to IE9

0
0

HI all,

The app works fine in IE8. When upgraded to IE9, the problem is appears. The code is not changed.

In the javascript there is a function which calls a server side subroutine with parameter. The problem is: Sometime the subroutine is performed, somethime not, even the parameter/data is the same.

What I have doen is:

-Add the site as a trusted side in Internet Options/Security

-Add this in the header of the aspx file.: <meta http-equiv="X-UA-Compatible" content="IE=8" />

but it doesn't work, same problem: sometime works, sometime not.

Here is the javascript in aspx file:

function IsOK()
{
//alert("in isOK.")

   var erro = '';
   var MasterID = document.getElementById('<%= hid_masterID.ClientID %>').value;
   var IID = document.getElementById('<%= hid_ID.ClientID %>').value;
   var PostID = document.getElementById('<%= ddlGemeente.ClientID %>').value;
   var FunctieID = document.getElementById('<%= ddlFunction.ClientID %>').value;
   var StatusID = document.getElementById('<%= ddlNewStatus.ClientID %>').value;
   var ResultaatID = document.getElementById('<%= ddlResultaat.ClientID %>').value;
   //alert("now goes to server side.")
   PageMethods.saveData(MasterID, IID, PostID, FunctieID, StatusID, ResultaatID);
}


In aspx I have ScriptManager like this:

<asp:ToolkitScriptManager ID="tsmanager" runat="server" ScriptMode="Release" EnablePageMethods="True"></asp:ToolkitScriptManager>

In the server side (aspx.vb):

<System.Web.Services.WebMethod()> _
Public Shared Sub saveData(ByVal MasterID As Integer, ByVal IID As Integer, ByVal PostID As Integer, ByVal FunctieID As Integer, ByVal StatusID As Integer, ByVal ResultaatID As Integer)
   Dim cn As New SqlConnection
   Dim cmd As New SqlCommand
   Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings.Item("strConn"))

   saveLogfile(MasterID, IID, Usernaam, "In saveData serverside (solldetail_wijzigen.aspx) geraakt op: " + Date.Now().ToString())

   cn = conn
   cmd.Connection = cn
   cmd.CommandType = CommandType.StoredProcedure
   cmd.CommandText = "uspSoll_SollDetailUpdate"
   cmd.Parameters.Add("@MasterID", SqlDbType.Int).Value = MasterID
   cmd.Parameters.Add("@IID", SqlDbType.Int).Value = IID
   cmd.Parameters.Add("@PostID", SqlDbType.Int).Value = PostID
   cmd.Parameters.Add("@FunctieID", SqlDbType.Int).Value = FunctieID
   cmd.Parameters.Add("@StatusID", SqlDbType.Int).Value = StatusID
   If ResultaatID = 1 Then
      cmd.Parameters.Add("@ResultaatID", SqlDbType.Int).Value = 0
   Else
      cmd.Parameters.Add("@ResultaatID", SqlDbType.Int).Value = ResultaatID
   End If
   cn.Open()
   Try
      cmd.ExecuteNonQuery()
   Catch ex As Exception
      saveLogfile(MasterID, IID, Usernaam, ex.Message.ToString)
   End Try
   cn.Close()
End Sub

I have searched for this bug for 2 days, but I could not solve it. Can anybody please let me why sometime works, sometime not.

Thanks in advance. Juliando

Dynamically Added Controls inside of panel and one timer are not working/causes full post back in updatepanel

0
0

hiii FRNDS

Dynamically Added Controls inside of panel and one timer are not working/causes full post back in updatepanel.

in this, panel and timer both are inside a table on which update panel is applied

<asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional"
ChildrenAsTriggers="true">

<ContentTemplate>
<table width="100%" cellpadding="9px" cellspacing="9px" >
<tr>

<td ><table>

<tr>
<td align="right">


<asp:Timer ID="perQuestionTime" runat="server" Interval="1000" OnTick="perQuestionTime_Tick"></asp:Timer>

<asp:Label ID="lblperqestiontime" runat="server" Text="" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Large" ForeColor="#e08846" />  -----In this panel i m generating dynamically LinkButton at run time----

</td>

</tr>

</table></td>

<td valign="top" align="center" width="20%"><b>Choose Question:</b><br /> <br />
<asp:Panel ID="PanelToDynamicControl" runat="server" BorderWidth="2px" BorderStyle="Solid" style="padding-right:10px">
</asp:Panel>
</td>
</tr>
</table>


<div align="left" >

<asp:Button ID="btnPrev" runat="server" Text="Previous" OnClick="btnPrev_Click" CssClass="AllButton" />
<asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" CssClass="AllButton" />
<asp:Button ID="btnSkip" runat="server" Text="Skip" OnClick="btnSkip_Click" CssClass="AllButton" />

</div>
</ContentTemplate> </asp:UpdatePanel>

Setting up data on the server side for PageRequestManager events

0
0

To me the on-line documentation in this area is either missing, incomplete, or fuzzy. Here's what I'd like to do:

On the server side:

  • register a data object (such as a structured object consisting of 2-10 strings) as a dataItem that not associated to a control but can be accessed by one of my client side PageRequestManager event handlers (like endRequest or PageLoading)
  • populate the registered DataItem with data and then call the UpdatePanel's Update method.

From the documentation it looks that this is do-able but I don't see how it's accomplished on the server side.

Could someone provide me with a simple example, or at least a clearer direction on how to get this done?

Ajax.ActionLink not working properly with onBegin parameter

0
0

I have function that is called in "onBegin" ajax option of ajax.actionlink

function cancelAction() {$.ajax({
        data: { p: "test", z: "value" },
        url: '@Url.Action("DoSomething", "TestCtlr")',
        type: "GET",
        dataType: "json",
        success: function (data) {
            if (data.do == 0) {
                 // do something
            }

            else {
                alert("error message");
            }

        },

    }
    )}
return false;
}


and ajax.actionlink

@Ajax.ActionLink("Click here",//link text"Insert",// action name"Projects",// controllernew{ poz = item.itemID.ToString()},// route values newAjaxOptions(){HttpMethod="GET",UpdateTargetID="PrjDiv",OnBegin="cancelAction",OnSuccess="Initiate_Dialog"},// ajax optionsnew{@class="openDialog",@id= item.idemID.ToString()}//htmlAttributes)

Click on ajax.actionlink should check in database (onbegin) if there's record with parameters p and z (data) and if there's none, to call jquery ui dialog (Initiate_Dialog) to insert record in database. If record in database exists, action should be canceled ("cancelAction")

Problem is with "//do something part" of code.

I tried to put 

$.ajax(this.url)
 and 
$.ajax(this.href) there, to continue with my function, but it's not working.

Can someone help me with this?

assign dynamic arrayTodataTable using C#.net for Google column chart.

0
0

Hi,

private void BindColumnChart()
    {
        DataTable dt = new DataTable(); StringBuilder str = new StringBuilder();
        try
        {
            var q = string.Empty;
            q =
@"SELECT	 dbo.SubjectMaster.SubjectName
            		,dbo.QuestionPaper.Division
            		,dbo.QuestionPaperDetail.Marks
            FROM	 dbo.QuestionPaper 
            		INNER JOIN dbo.SubjectMaster ON dbo.QuestionPaper.SubjectId = dbo.SubjectMaster.SubjectId 
            		INNER JOIN dbo.QuestionPaperDetail ON dbo.QuestionPaper.QuestionPaperId = dbo.QuestionPaperDetail.QuestionPaperId
            WHERE   (dbo.QuestionPaper.Semister = '1') AND (dbo.QuestionPaper.[Standard] = '9')
            GROUP BY dbo.SubjectMaster.SubjectName,dbo.QuestionPaper.Division,dbo.QuestionPaperDetail.Marks";

            DataSet ds = SqlHelper.ExecuteDataset(ObjCnp.getConnect(), CommandType.Text, q.ToString(), null);
            dt = ds.Tables[0].Copy();

            //-------------------------------------------------------------------------------------
            //List<string> result = new List<string>();
            System.Collections.ArrayList result = new System.Collections.ArrayList();
            foreach (DataRow dtrow in ds.Tables[0].Rows)
            {
                result.Add(dtrow);
            }

            str.Append(@"<script type='text/javascript'>
                    google.load('visualization', '1', { packages: ['corechart'] });
                    function drawVisualization() {
                        var data = google.visualization.arrayToDataTable([ // Create and populate the data table.
//                          ['Subject', 'A', 'B', 'C', 'D', 'E', 'F'],
//                          ['English', 50, 60, 70, 30, 80, 80],
//                          ['Maths', 30, 50, 40, 30, 50, 80],
//                          ['Science', 20, 50, 30, 80, 50, 90],
//                          ['Hindi', 100, 20, 30, 80, 50, 30]
                        ]);
                        new google.visualization.ColumnChart(document.getElementById('visualization')). // Create and draw the visualization.
                            draw(data,
                                 {
                                     title: 'Semister Marks Obtainded by Subject',
                                     width: 600, height: 400,
                                     hAxis: { title: 'Subject' }
                                 }
                            );
                    }
                    google.setOnLoadCallback(drawVisualization);</script>");

            //var stringArr = dt.Rows[0].ItemArray.Select(x => x.ToString()).ToArray();
            ct.Text = str.ToString().TrimEnd(',').Replace('*', '"');
        }
        catch
        { }
    }

if i uncomment the array then it will work fine.

but i need to assing dynamic arrayToDatatable.

please anybody help me.....

thanks in advance.


                       

ajax toolkit 4.5 ClearMaskOnLostFocus=true not working

0
0

Hi,

I am facing problem in ajax toolkit 4.5:

In Maskeditextendar I set ClearMaskOnLostFocus=true but on click once on the text box and lost folcus the mask not get disappear.

I have following code:

  <asp:TextBox ID="txtDOB" runat="server"></asp:TextBox>
                                                    <asp:ImageButton ID="ImgBntCalc" ImageAlign="Middle" runat="server" CausesValidation="False"
                                                        ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                                    &nbsp;&nbsp;<span style="color: #999999">(DD/MM/YYYY)</span>
                                                    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" CultureAMPMPlaceholder="AM;PM"
                                                        CultureCurrencySymbolPlaceholder="£" CultureDateFormat="DMY" CultureDatePlaceholder="/"
                                                        CultureDecimalPlaceholder="." ClearMaskOnLostFocus="true" UserDateFormat="DayMonthYear"
                                                        CultureName="en-GB" CultureThousandsPlaceholder=","
                                                        CultureTimePlaceholder=":" Enabled="True" ErrorTooltipEnabled="True" Mask="99/99/9999"
                                                        MaskType="Date" TargetControlID="txtDOB">
                                                    </cc1:MaskedEditExtender>
                                                    <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
                                                        ControlToValidate="txtDOB" Display="Static"  EmptyValueBlurredText="*" EmptyValueMessage="Date is required"
                                                        ErrorMessage="MaskedEditValidator1" InvalidValueBlurredMessage="*" InvalidValueMessage="Date is invalid"
                                                        TooltipMessage="Input a date" ValidationGroup="DtVal"></cc1:MaskedEditValidator>
                                                    <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" Format="dd/MM/yyyy"
                                                        PopupButtonID="ImgBntCalc" TargetControlID="txtDOB">
                                                    </cc1:CalendarExtender>

Preventing modalpopup from showing on page refresh???

0
0

Hello everyone, I have a question about ajaxcontroltoolkit modal popup control. I have a page and everything is working fine with calling modalpopup to show or hide. I set the cancelControlID to Button1. But when I clicked Button1 and pressed page refresh, the modalpopup automatically shows up again. Is there away to stop this?

Thank you very much. 

How to solve A potentially dangerous Request.Form in asp.net?

0
0

Actually we are created application using asp.net. after run the asp.net application then user enter * or : or any Html tags in end of the url the enter then throw following  errors,

A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtTextResume="<a href=http://seabr...").

A potentially dangerous Request.Path value was detected from the client (:).

A potentially dangerous Request.Path value was detected from the client (&).

these errors are throws in url

For Ex: www.abc.com\page1.aspx*

          or

         www.abc.com\page1.aspx:

Etc...

 some others sites are handled this.

let me know if any body knows.

Thanks in Advance

 

Advantage of updatepanel ?

0
0

Hi

Upto now, i had understand that while using update panel in asp.net web form, it will increase the performance by using Asynchronous calls and minimum data transfer to server

and it will most suitable while using heavy control in webform like gridview or datalist with edit,delete functionalities.

But today while doing discussion with friends, they were telling there will be no minimum data transerfer from client to server, it will send full html data with viewstate to sever so there is no advantage related with bandwidth, it will only avoid the page full postback.

Could you tell me, which one is the correct ?

How to get a custom control to trigger and UpdatePanel to refresh.

0
0

I have an update panel that contains a multi-line textbox.  I have a custom control that I'd like to have trigger the update panel to refresh.  Everything is working with the exception of the update panel updating.  Events are getting triggered properly. But no update to the update panel.  

Below is my code for my page:

<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:scriptmanager ID="Scriptmanager1" runat="server" EnablePartialRendering="true" ></asp:scriptmanager><asp:FileUpload ID="FileUpload" runat="server" /><br /><asp:Button ID="LoadFileButton" runat="server" Text="Load File" OnClick="LoadFileButton_Click" /><asp:Label ID="FileNameLabel" runat="server" Visible="false" /><br /><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"><ContentTemplate><asp:Panel ID="Panel1" runat="server"><asp:TextBox ID="OutputTextbox" runat="server" Width="640px" Height="320px" TextMode="MultiLine" ReadOnly="True"  /></asp:Panel><br /><asp:Button ID="ProcessButton" runat="server" Text="Process" Enabled="false" Visible="false" OnClick="ProcessButton_Click" /></ContentTemplate><Triggers><asp:PostBackTrigger ControlID="LoadFileButton" /></Triggers></asp:UpdatePanel></div></form></body></html>

Here is my code behind:

        protected void Page_Load(object sender, EventArgs e)
        {
            this.InitControls();
        }

        protected static bool ProcessStarted = false;

        protected static string Message;

        protected TriggerControl TriggerControl;

        protected void InitControls()
        {
            this.TriggerControl = new TriggerControl();
            this.TriggerControl.ID = "TriggerControl";
            this.TriggerControl.EventTriggered += this.TriggerControl_EventTriggered;

            this.Scriptmanager1.RegisterAsyncPostBackControl(this.TriggerControl);

            this.Page.Controls.Add(this.TriggerControl);

            UpdatePanel up = this.Page.FindControl("UpdatePanel1") as UpdatePanel;

            if (up != null)
            {
                AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
                trigger.ControlID = this.TriggerControl.ID;
                trigger.EventName = "EventTriggered";

                up.Triggers.Add(trigger);
            }
        }

        protected void WorkerFunction()
        {
            Message = "";

            // Create worker class.
            ImportController import = new ImportController(10);
            // Add event handlers.
            import.ProcessFinished += import_ProcessFinished;
            import.ProcessStarted += import_ProcessStarted;
            import.ProgressChanged += import_ProgressChanged;
            // Process the work.
            import.Process();
            // Remove event handlers.
            import.ProcessFinished -= import_ProcessFinished;
            import.ProcessStarted -= import_ProcessStarted;
            import.ProgressChanged -= import_ProgressChanged;
        }

        protected void LoadFileButton_Click(object sender, EventArgs e)
        {
            HttpContext.Current.Session["FileNameToProcess"] = this.FileUpload.FileName;
            HttpContext.Current.Session["FileBytesToProcess"] = this.FileUpload.FileBytes;

            this.FileUpload.Enabled = false;
            this.FileUpload.Visible = false;

            this.LoadFileButton.Enabled = false;
            this.LoadFileButton.Visible = false;

            this.FileNameLabel.Text = String.Format("File to be processed: {0}", this.FileUpload.FileName);
            this.FileNameLabel.Enabled = true;
            this.FileNameLabel.Visible = true;

            this.ProcessButton.Enabled = true;
            this.ProcessButton.Visible = true;
        }

        protected void ProcessButton_Click(object sender, EventArgs e)
        {
            if (!ProcessStarted)
            {
                ProcessStarted = true;

                string name = HttpContext.Current.Session["FileNameToProcess"].ToString();

                Thread worker = new Thread(new ThreadStart(this.WorkerFunction));
                worker.Start();

                return;
            }
        }

        protected void import_ProcessFinished(object sender, EventArgs e)
        {
            ProcessStarted = false;
        }

        protected void import_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            Message += e.ProgressMessage;
            this.TriggerControl.InvokeEventTriggered();
        }

        protected void import_ProcessStarted(object sender, EventArgs e)
        {
            this.ProcessButton.Enabled = false;
        }

        protected void TriggerControl_EventTriggered(object sender, EventArgs e)
        {
            if (Message != "")
            {
                this.OutputTextbox.Text = this.OutputTextbox.Text + Message;
                Message = "";
            }
        }

    }

    public class TriggerControl : Panel, IPostBackDataHandler
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void InvokeEventTriggered()
        {
            this.OnEventTriggered(this, new EventArgs());
        }

        // Delegate
        public delegate void EventTriggeredHandler(object sender, EventArgs e);
        // Event
        public event EventTriggeredHandler EventTriggered;

        /// <summary>
        /// Fires the EventTriggered event.
        /// </summary>
        /// <param name="sender">Object representing the sender of the event.</param>
        /// <param name="e">ProgressChanged event arguments.</param>
        protected void OnEventTriggered(object sender, EventArgs e)
        {
            if (EventTriggered != null)
            {
                EventTriggered(this, e);
            }
        }

        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            return true;
        }

        public void RaisePostDataChangedEvent()
        {
            
        }
    }

There is a file that gets uploaded using the FileUpload control first.  It posts back and the page updates a label with the name of the file that is going to be processed.  Pressing the Process button then creates a thread and calls a function to do some work on the file that was uploaded.  That process will then fire events every so often reporting back the status of the job.  That event handler will then invoke the TriggerControl's EventTriggered event, which should then cause the UpdatePanel to refresh. The UpdatePanel is not refreshing and I don't know why.  All the events are triggering properly.

If anyone has any ideas on how to make this work please let me know.

HTMLEditorExtender Source View Unusuable (one line)

0
0

The source view of the HTMLEditorExtender shows the HTML all on one massive wrapped line.  Totally unusable and unreadable.  I opened the HTML in a text editor (like notepad) and it looks fine.  What am I doing wrong?

Parser Error: System.IO.FileNotFoundException: Could not load file or assembly

0
0

I have a Visual Studio 2013 solution with about ten projects in it from which I have removed one project, called AjaxControls. After deploying the solution using Visual Studio to IIS 7.5 (Windows 7 development machine), I get a "Parser Error" message in the browser saying that the server cannot load the assembly "AjaxControls". The full text of the Elmah error message is below (it is more helpful than the YSOD shown in the browser). I have no problem running the site when I am debugging it in Visual Studio.

Troubleshooting steps taken:

  1. Searched my entire solution for references to AjaxControls. None found.
  2. Deleted all files in the deployment directory.
  3. Deleted all temporary ASP.NET files located in the Windows\Microsoft.net directory.
  4. Used ILSpy and other tools to find out if this assembly is somehow referenced in another way. It is not.
  5. Restarted VS, restarted computer.  I have the same problem on my deployment server.

I can solve the problem by simply copying the AjaxControls.dll into my bin directory, but I would like to find a more permanent solution than this hack.

Thanks for your help.

Here is the Elmah stack trace:

System.IO.FileNotFoundException: Could not load file or assembly 'AjaxControls' or one of its dependencies. The system cannot find the file specified.
Generated: Wed, 23 Apr 2014 16:17:16 GMT

System.Web.HttpParseException (0x80004005): Could not load file or assembly 'AjaxControls' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'AjaxControls' or one of its dependencies. The system cannot find the file specified.
File name: 'AjaxControls'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssembly(String assemblyName, Boolean throwOnFail)
   at System.Web.UI.TemplateParser.AddAssemblyDependency(String assemblyName, Boolean addDependentAssemblies)
   at System.Web.UI.MainTagNameToTypeMapper.ProcessTagNamespaceRegistrationCore(TagNamespaceRegisterEntry nsRegisterEntry)
   at System.Web.UI.MainTagNameToTypeMapper.ProcessTagNamespaceRegistration(ArrayList nsRegisterEntries)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Note that I can turn on assembly binding, but all it does is tell me that it can't find the file. I don't want to find the file, I want to find what is referencing the file and change it, but all I get is "Calling assembly : (Unknown)."

Note also that I have also posted this question on StackOverflow.com:  http://stackoverflow.com/questions/23254284/parser-error-system-io-filenotfoundexception-could-not-load-file-or-assembly


ajaxToolkit:CalendarExtender setting initial month displayed when calendar pops up

0
0

I have two textbox objects (FromDate and ToDate) on my page (in an UpdatePanel). Each is tied to separate CalendarExtender (CalendarExtenderFrom and CalendarExtenderTo). When I set a date value in theFromDate textbox that is some number of months in the past (I.E. 07/01/2013) I have code behind that sets the StartDate and EndDate on theToDate's CalendarExtender. This does work to provide a range of dates for the ToDate's CalendarExtender's popup such that the user cannot select a date prior to the FromDate value. However, when I then click in the ToDate textbox the calendar opens in the current month (I.E. April 2014). I want it to open in July 2013.

I know that if, in the code behind, I set CalendarExtenderTo.SelectedDate equal to the FromDate value then when I click in the ToDate's textbox the calendar opens in the month I want. However, Ido not want the ToDate's textbox to display that date or any date. I want ToDate to remain empty until the user actually selects something from the popup calendar. 

Is there some way to set the initial month/year a CalendarExtender displays without actually setting a value in the textbox associated with the CalendarExtender?

How to Close Modal popup from another page which is inside an iframe??

Creating an Ajax-Enabled Web Site

Confirm box in asp.net

0
0

Helloo All,

how to use confirm box in asp gridview when using row deleting event in gridview.... here am using delete (type as image) from command field

i have given below the code which i have using now... but its not working properly...

client side

==========

    <script type="text/javascript">
     function confirmation() {
         if (confirm('are you sure you want to delete ?')) {
             return true;
         } else {
             return false;
         }
     }
    </script>

=========

Server side

======

  protected void gdv_RowDeleting1(object sender, GridViewDeleteEventArgs e)
    {
        
        Session["Agent_Id"] = gdv.Rows[e.RowIndex].Cells[0].Text;
        if (DeleteData())
        {

            lblMsg.Visible = true;
            lblMsg.Text = "Deleted Successfully";
            clear();
            fillGrid();
        }
        else
        {

            lblMsg.Visible = true;
            lblMsg.Text = "Error on Deleting..";
        }
    }

======================================

but its working well when it using button when it call like this

  <asp:Button ID="btnDelete"  runat="server" Text="Delete" OnClientClick="return confirmation();"
                Width="60px" Visible="False" onclick="btnDelete_Click"/>

my problem is how can i call the abouve javascript function in row deleting event....

does any one knows to solve my problem please help me to find a better solution,.....

thanks in advance

scrollimg

0
0

Hello,

 

I have a chat application I am working on inside of an update panel with timers. The area that the chat is foing into is "ChatContent" however it always scrolls to the top when a new message is added. the section is not scrollable nor does it automatically load at the bottom of the chat box

How do I fix this? . ..............I have tried

vertical-align: top and

overflow-y: auto;

along with a few other suggestions found in forums here and by googling........

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"><ContentTemplate><div id="ChatContent" runat="server" style="height: 365px; vertical-align: top; overflow-y: auto;
                                                            text-align: left; margin-left: 10px; width: 97%;">  </div> </ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /></Triggers></asp:UpdatePanel><asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer><asp:Timer ID="Timer2" runat="server" Interval="5000" OnTick="Timer2_Tick"></asp:Timer><asp:Timer ID="Timer3" runat="server" Interval="300000" OnTick="Timer3_Tick"></asp:Timer>

Viewing all 5678 articles
Browse latest View live




Latest Images