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

Ajax tabbed panel issues

$
0
0

ajax tabbed panel header text not appearing. Have use <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager> but it didn't work, this is my code.

ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
<ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="138px" ActiveTabIndex="0"
Width="402px">
<ajaxToolkit:TabPanel runat="server" ID="Panel1" HeaderText="Address">
<ContentTemplate>
<asp:UpdatePanel ID="updatePanel1" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
First Name:
</td>
<td>
<asp:TextBox ID="txtName" runat="server" />
</td>
</tr>
<tr>
<td>
Address:
</td>
<td>
<asp:TextBox ID="txtAddress" runat="server" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="Panel3" HeaderText="Nested Tabs">
<ContentTemplate>
<ajaxToolkit:TabContainer runat="server" ID="NestedTabContainer1" Height="138px"
ActiveTabIndex="0" Width="402px">
<ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="Address">
<ContentTemplate>
<asp:UpdatePanel ID="updatePanel2" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
First Name:
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" />
</td>
</tr>
<tr>
<td>
Address:
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="Email">
<ContentTemplate>
Email:
<asp:TextBox ID="txtEmail" runat="server" />
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="TabPanel3" HeaderText="Login Details">
<ContentTemplate>
<table>
<tr>
<td>
User Name:
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server" />
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server" />
</td>
</tr>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="Panel2" HeaderText="Login Details">
<ContentTemplate>
<table>
<tr>
<td>
User Name:
</td>
<td>
<asp:TextBox ID="txtUser" runat="server" />
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<asp:TextBox ID="txtPass" runat="server" />
</td>
</tr>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>


tab panel

$
0
0

How do you call the another updatepanel in the same tab?

Ajax Extensions referenced incorrectly in migrated project

$
0
0

Hi,

Please help. This is driving me nuts.

I migrated a web forms project from VS2008 .NET3.5 to VS2013 .Net3.5

I now find every time I edit the markup the designer.vb get's corrupted.

It get's changed from

    Protected WithEvents UpdatePanel1 As Global.Web.UI.UpdatePanel

to

    Protected WithEvents UpdatePanel1 As Global.AjaxControlToolkit.UpdatePanel

This does not happen on my colleague's machine when she edits the same file.

It also does not happen with all Ajax enabled projects on my machine

Here's a related post which seems unresolved

http://forums.asp.net/t/1870977.aspx?AJAX+Extensions+undefined+on+open+aspx+page+after+upgrade+to+VS2012+on+Win+7+64bit

Thanks

fid

add and remove panels

$
0
0

How do you call the same updatepanel in the same tab panel?By pressing a button onclick, it will add a updatepanel below, or do you have any other ways to create multiple updatepanel in the same form.

How to Fire Textchange from modal popup

$
0
0

Hi ,

Is it possible to trigger the textchange event of a page from a modal popup?

Here's what I have User Control inside a Modal popup

GridView User Control is wrap with update panel so that I can update My TxtName

Passing Gridview SelectedItem to my TxtName.Text

    Protected Sub Select_Clicked(ByVal sender As Object, ByVal e As EventArgs)
        Dim currentrow As GridViewRow = TryCast(DirectCast(sender, Control).Parent.NamingContainer, GridViewRow)

        CType(Me.Parent.Parent.FindControl("txtId"), TextBox).Text = currentrow.Cells(1).Text
        CType(Me.Parent.Parent.FindControl("txtName"), TextBox).Text = currentrow.Cells(2).Text

        CType(Me.Parent.Parent.FindControl("MPE"), AjaxControlToolkit.ModalPopupExtender).Hide()

    End Sub

Value successfully pass but txtName.TextChanged event didn't fire Yell

<asp:UpdatePanel runat="server" ID="UpdateFace" UpdateMode="Conditional"><ContentTemplate><asp:TextBox ID="txtName" runat="server" ReadOnly="True" AutoPostBack="true" /></ContentTemplate></asp:UpdatePanel>

//Nothing happen even on debug mode

 Protected Sub txtName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
//Some Operation
Me.btnUpdate.Enabled = True End Sub

Focus event of AJAX HTML editor

$
0
0

Hi

How can I fire the onfocus event of HTML editor.

AjaxFileUpload causes javascript error with authorization

$
0
0

Using AjaxFileUpload in WebForms targetting .NET 4.5.1, I get a javascript error only under a certain condition. This is the error:

throw "error raising upload complete event and start new upload"

And the condition:

Error only occurs when I include a web.config authorization element somewhere in the page's directory tree: deny users="?"

If I comment out the condition to restrict to authenticated users, AjaxFileUpload works successfully. If I apply this as a single condition in the authorization element (deny users), then the error is thrown.

Stop Javascript Loader When Ajax Update Complete

$
0
0

Hi guys

I have an application that I am writting.

I use a javascript Loader which appears as a modal for when data is loading a bit slow.

It works great until I get to one page.

On this page I have a modal that loads on page load.

In the modal I have a series of search criteria.

When the Search button is clicked a Datagrid within the modal loads data.

To make this more dynamic and stop the datagrid repainting everytime a search is requested I have surrounded the controls on the modal with an AJAX Update Panel.

When the search button is clicked the Loader Modal appears as expected.

The only problem is that it doesnt then go away once the datagrid is loaded.

I also use masterpages and the code for the loader is on the masterpage.

I have tried using Javascript calls to close the loader but I cant get it to work.

I included a function that closes the loader when any ajax.complete action is detected but this doesnt work either.

Any suggestions??


Charting configuration problem in web.config file

$
0
0

well I used chart in my project its working fine on localhost ...

when I add refrence and dll file of System.Web.DataVisualization then many tags open in web,config file please check  it till below

<?xml version="1.0"?><!--
  For more information on how to configure your ASP.NET application, please visit  http://go.microsoft.com/fwlink/?LinkId=169433  --><configuration><appSettings><add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" /></appSettings><system.webServer><handlers><remove name="ChartImageHandler" /><add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
       path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></handlers></system.webServer><connectionStrings><add name="AuzineConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Auzine;User ID=sass;Password=abc;" providerName="System.Data.SqlClient"/></connectionStrings><system.web><httpHandlers><add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        validate="false" /></httpHandlers><compilation debug="true" targetFramework="4.0"><assemblies><!--the Below Line is unknow and added automatically ...I do not know--><add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><pages><controls><add tagPrefix="CKEditor" assembly="CKEditor.NET" namespace="CKEditor.NET"/><!--below is used for asyncfileupload--><add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagPrefix="Syed"/><add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
            assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></controls></pages><customErrors mode="Off"/></system.web></configuration>

but when I was hosting it on server then one tag creating problem , when remove this tag then working fine but when I insert this tag then it gives error and website not loading

in browser

 the tag is creating error on webserver is below

<httpHandlers><add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        validate="false" /></httpHandlers>

why ...? what is the imporance of this line can anyone tell me the solution of this....

and one more thing ... how to locate  the folder in http in this tag

<appSettings><add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" /></appSettings>

I have tried but it gives error

Invalid temp images directory in chart handler configuration

Please edit the web.config file. The CharImageHandler key, Dir value must point to a valid directory. The directory is required for temporary image storage when storage mode equals file system.

Problems with ModalPopupExtender

$
0
0

Hello everyone and thanks for your help in advance.  I am completely new to the AJAX toolkit and want to use the ModalPopupExtender to edit a gridview rather than the typical inline method.  I am running into problems and amnot sure why.  The error I am receiving is:

The TargetControlID of 'popup' is not valid. A control with ID 'lnkEdit' could not be found

I have created the following code:

<ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajax:ToolkitScriptManager><div><span class="heading"><asp:Literal ID="ReportType" runat="server"></asp:Literal>&nbsp;Requiring 
		Practitioner Action</span><br /><br /><asp:DataGrid ID="DocsFileList" runat="server" OnItemDataBound="RenderData" GridLines="Horizontal"
		cellpadding="4" CssClass="DataGrid" AutoGenerateColumns="False"><Columns><asp:TemplateColumn HeaderText="MR Number"><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Literal ID="ltlMRNumber" runat="server"></asp:Literal></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate>&nbsp;&nbsp;</ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="Patient Name"><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Literal ID="ltlPatientName" runat="server"></asp:Literal></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate>&nbsp;&nbsp;</ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="Patient DOB"><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Literal ID="PatientDOB" runat="server"></asp:Literal></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate>&nbsp;&nbsp;</ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="Time Created"><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Literal ID="ltlTimeCreated" runat="server"></asp:Literal></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate>&nbsp;&nbsp;</ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="Tests Performed"><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Literal ID="ltlTests" runat="server"></asp:Literal></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate>&nbsp;&nbsp;</ItemTemplate></asp:TemplateColumn><asp:TemplateColumn HeaderText="  "><HeaderStyle CssClass="DataGridHeaderGreen"></HeaderStyle><ItemStyle CssClass="DataGridText"></ItemStyle><ItemTemplate><asp:Button ID="btnReview" Text="Review" OnCommand="btnReview_Click" runat="server"></asp:Button></ItemTemplate></asp:TemplateColumn><asp:TemplateColumn><ItemTemplate><asp:LinkButton ID="lnkEdit" runat="server" Text = "Edit"></asp:LinkButton></ItemTemplate></asp:TemplateColumn></Columns></asp:DataGrid><asp:Panel ID="pnlAddEdit" runat="server" CssClass="modalPopup" style = "display:none"><asp:LinkButton ID="lnkFake" runat="server"></asp:LinkButton></asp:Panel><ajax:ModalPopupExtender ID="popup" runat="server" DropShadow="false" PopupControlID="pnlAddEdit" TargetControlID = "lnkEdit" BackgroundCssClass="modalBackground"></ajax:ModalPopupExtender></div>

Any help would be greatly appreciated.

Combined script for default control bundle is not getting cached in browser

$
0
0

I have added a CombineScriptsHandler in web.config and added a ToolkitScriptManager with the propertier ScriptMode="Release" CombineScripts="true".

I could see that its combining the scripts to one file CombineScriptsHandler.axd in the response, but for somereason, its not getting cached in the browser (with a 304 Not Modified), instead it issues a seperate request on every refresh and ends up with 200 OK response).

As per Stephen Walther's detailed documentation here , the combinedscript file is supposed to be cached - but unfortunately its not working for me.

Is there any additional steps I am missing here to have this combined script file cached? Please advice.

repeater delete command confirm popup for user input

$
0
0
 

Hi

I have added AJAX to my web site and have looked at the various control extenders such as confirm button extender, modal popup extender, etc. They all seem to be linked to a specific control on the page – ie – a button, link button, etc. which the control name is know at design time.


What I want to do is using client side coding (java? Ajax?) have a confirming popup if the user selects the delete command (see the code snippet taken from a repeater control). Highlighted below that in red, you can see the name of the repeater linkButton changes thus none of the Ajax extenders seem to work.


Summarizing, if one of the delete linkButtons is pressed by the user, the Javascript should intercept the postback, create a popup that tests the user to ensure the delete command should be carried out, close the popup and allow the postback to proceed normally. If the user aborts the delete command, then the popup should close and no further action take place.


Is there somewhere I can find code such as this or have I misunderstood the Ajax entenders? Or can some Java guru write the code for me (I know very little about Javascript). (I have been using VB code behind but I think what I require should reside on the .aspx page)


Thanks in advance for your help and have a nice day.



<tdstyle="border-bottom:1px solid #808080"align="left">

<asp:LinkButtonID="btnEdit"runat="server"

CommandName="Edit"

CommandArgument=<%#CreateDetailString(Ctype(Container.DataItem, Data.DataRowView).Item(0)) %>

>Edit

</asp:LinkButton>

<asp:LinkButtonID="btnDelete"runat="server"

CommandName="Delete"

CommandArgument=<%#CreateDetailString(Ctype(Container.DataItem, Data.DataRowView).Item(0)) %>

>Delete

</asp:LinkButton>

<%#CType(Container.DataItem, Data.DataRowView).Item(1) %>

</td>




<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl00_btnEdit" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl00$btnEdit','')">Edit

</a>

<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl00_btnDelete" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl00$btnDelete','')">Delete

</a>


<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl01_btnEdit" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl01$btnEdit','')">Edit

</a>

<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl01_btnDelete" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl01$btnDelete','')">Delete

</a>

<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl02_btnEdit" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl02$btnEdit','')">Edit

</a>

<a id="ctl00_ContentPlaceHolder1_Repeater1_ctl02_btnDelete" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Repeater1$ctl02$btnDelete','')">Delete

</a>

expandable/collapsible grid using CollapsiblePanelExtender and DynamicPopulateExtender

$
0
0

Like many before me I have been trying to implement a tidy expandable/collapsible gridview where, for example, the grid initially shows a list of writers and on clicking on a suitable 'expand' button in a row the writer's works are dynamically retrieved from the database and displayed. Actually I have managed to get a reasonably tidy version to work using the Ajax Toolkit CollapsiblePanelExtender and DynamicPopulateExtender in combination with minimal additional Javascript. In case it is of any use to anyone, the key elements are as follows:

<asp:GridView runat="server" ID="Writers" DataSourceID="WritersDS" DataKeyNames="PersonID" PageSize='<%$ AppSettings: GridPageSize %>' ><Columns><asp:TemplateField ShowHeader="False" ItemStyle-VerticalAlign="Top"><ItemTemplate><asp:Image ID="ShowWorksButton" runat="server" /><ajaxToolkit:DynamicPopulateExtender ID="DPE" runat="server" PopulateTriggerControlID="ShowWorksButton" CacheDynamicResults="false" ClearContentsDuringUpdate="true" EnableViewState="False"
            ServiceMethod="GetWorks" ContextKey='<%# Eval("PersonID") %>' TargetControlID="WorksPanel" /></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="writer" SortExpression="Surname" ItemStyle-Width="200" ItemStyle-VerticalAlign="Top"><ItemTemplate><asp:Label ID="hName" runat="server" Text='<%# Eval("Name")%>' /></ItemTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="750"><ItemTemplate><asp:Panel ID="WorksPanel" runat="server" EnableViewState="false" style="height:auto;min-height:36px;max-height:124px;overflow:auto"/><ajaxToolkit:CollapsiblePanelExtender ID="CPE" ClientIDMode="Static" runat="server" TargetControlID="WorksPanel" ExpandControlID="ShowWorksButton" CollapseControlID="ShowWorksButton"
            ImageControlID="ShowWorksButton" CollapsedImage="~/images/expand.png" ExpandedImage="~/images/collapse.png"
            Collapsed="True" CollapsedSize="0" ExpandedSize="124" ScrollContents="True" AutoCollapse="False" AutoExpand="False" /></ItemTemplate></asp:TemplateField></Columns>

And in code behind:

<WebMethod()> _<ScriptMethod()> _
    Public Shared Function GetWorks(ByVal contextKey As String) As String
        Dim dal As New DAL
        Dim personid As Integer = CInt(contextKey)
        Dim html As StringBuilder = New StringBuilder
        html.Append("<table><col width='480px'</col><col width='70px'</col><col width='110px'</col><col width='35px'</col><col width='50px'</col>")
        html.Append("<tr><th style='text-align:left;'>title</th><th style='text-align:left;'>form</th><th style='text-align:left;'>genre</th><th>written</th><th>owned</th></tr>")
        Dim works As List(Of LiteraryWorkInfo) = dal.GetSelectedWorksByWriter(personid)
        Dim owned As String = ""
        For Each work As LiteraryWorkInfo In works
            html.Append("<tr><td><a href='workform.aspx?id=" & work.WorkID.ToString() & "'>" & work.Title & "</a></td><td>" & work.Form & "</td><td>" & work.Genre & "</td><td style='text-align:center'>" & work.Written & "</td><td style='text-align:center'>" & work.Owned & "</td></tr>")
        Next
        html.Append("</table>")
        Return html.ToString()
    End Function

It is also necessary to make the CPE IDs unique (it is probably possible to do this declaratively):

    Protected Sub WireUpWorks(ByVal s As Object, ByVal e As GridViewRowEventArgs) Handles Writers.RowCreated
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim cpe As CollapsiblePanelExtender = CType(e.Row.FindControl("CPE"), CollapsiblePanelExtender)
            Dim id As String = String.Concat("CPE", e.Row.RowIndex)
            cpe.BehaviorID = id
        End If
    End Sub

And like others I have found it necessary to add some Javascript to smooth the animation (why this could not have been the default or at least easily changeable I do not know) and to provide an accordion-like effect:

function pageLoad(sender, args) {
    for (num = 0; num < 20; num++) {
        var cpe = $find("CPE" + num);
        if (cpe) {
            cpe.add_expanding(accordion);
            cpe._animation._fps = 45;
            cpe._animation._duration = 0.4;
        }
    }
}
function accordion(sender, arg) {
    for (num = 0; num < 20; num++) {
        var cpe = $find("CPE" + num);
        if (cpe) {
            if (sender._expandControlID != cpe._expandControlID)
                cpe.collapsePanel(cpe._expandControlID);
        }
    }
}

All of this works surprisingly well, but there are some irritating aspects which I have not been able to fix. I have limited the maximum height of the works panel in order to prevent the overall height of the grid causing vertical scrolling of the page. But what I would really like is for the CPE ExpandedSize to reflect the actual height of the panel (i.e. equivalent to 'auto'). But this does not appear possible and I have had to set ExpandedSize to the same value as the panel's maximum height (not setting ExpandSize at all has the surprising effect of causing the panel to pop out to the full size of the actual content with no animation, completely ignoring the CSS on the panel itself). As a result, the panel always expands to this height even if there is less actual content. And what is even more irritating is that there is a 'disabled' vertical scrollbar in the panel even if no scrolling is required (and if I remove ScrollContents="True" from the extender then, perhaps less surprisingly, there is no scrolling, despite the panel CSS). What I do not know is whether this is a CSS issue or something to do with the extender. Either way, I would be grateful for any suggestions how to fix this.

Jon

update panel with no page reload stops navigation

$
0
0

I use update panel with condition if  (!Ispostback)  for page to stop refresh and show listview  ,and i click on data pager , 

when i am on first page , i show 25 products , and click on 2 , it shows 25 to 50 products, but then again when i click on first page , no action is called,it does not show 1 to 25 products,,(i.e. it remains on second page with no action)...

Display actual values instead of percentage in Pie Chart

$
0
0

Hello,

I want to display actual value instead of percentage value.

I have used Pie Chart Control of Ajax Control Toolkit.

And also I want to apply custom style sheet on Pie Chart Control.

Please Help Me!!!

Thank You,

Nitigna Raval


Value cannot be null. Parameter name: propName??????

$
0
0

Has anyone seen this error? I fell confident it's being caused by some Javascript issue. However, I have know idea where to even look. I have no idea what is causing this. No where...I repeat nowhere in my project am I using a parameter called "propName". On the page where this occurs I have an CollapsilePanel, an ImageButton, a GridView and a SqlDataSource which is using a stored procedure needing one parameter; an integer call "ctrl_id". I am passing this in a Session variable. The error appears in a popup window after I click th imagebutton. The image button simple makes the GridView visible. This error came out of the blue...I have run this page a hundred times and haven't changed anything for days and then all of a sudden I get this.

Any help would be greatly appreciated

 

ToggleButtonExtender doesn't reflect Checked=true in code

$
0
0

I have a CheckBox with a ToggleButtonExtender to make it look nice.  If I click the image, it toggles and the appropriate image displays.  When a set the Checkbox1.Checked=true in code, the checkbox is toggled, but the image of the ToggleButtonExtender doesn't change.

How do you force the visual change when setting CheckBox1.Checked=true in code?

Show Updates on Progress

$
0
0

Hi,

I would like to show more information in my UpdatePanel. Instead of showing a simple "Please wait..." message, I would like to show which step it is currently at. Please refer to the sample code below.

I cannot seem to increment the step on the Tick event of the Timer control.

What is wrong?


Thanks,
ywb

<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test Timer</title>


    <script runat="server">

        private int stepNumber;

        protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) stepNumber = 1; }

        protected void Timer1_Tick(object sender, EventArgs e)
        {
            switch (stepNumber)
            {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    TextBox1.Text = "At step " + stepNumber.ToString();
                    System.Threading.Thread.Sleep(stepNumber * 1000);
                    break;
                default:
                    Timer1.Enabled = false;
                    break;
            }
            TextBox1.Text = "Timer Tick " + stepNumber.ToString();
        }
    </script>


</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="Scriptmanager1" runat="server"></asp:ScriptManager>

            <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick"></asp:Timer>

            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    <%=DateTime.Now.ToString() %>
                </ContentTemplate>
            </asp:UpdatePanel>

            <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0">
                <ProgressTemplate>
                    Updating...
                </ProgressTemplate>
            </asp:UpdateProgress>

        </div>
    </form>
</body>
</html>

'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception

$
0
0

Upgraded to latest Ajax release (Dec2013). My Website works fine on my pc, but when I move it to Godaddy it throws an error. If I use the asp scriptmanager page loads on website fine, but not with the ajax toolkit scriptmanager.a

Have spent two days researching and reading posts and I still cannot figure it out. I have listed the process below along with the error, masterfile, and config file. Can someone please tell me how I can correct this. Thanks, in advance.

Process:

-VS2010 selected create New Website (not project) 
-Installed Nuget Package Manager
-Installed AjaxControllToolkit
-Added ajax Tab to toolbox
-On ajax toolbox tab RightClick choose items and browsed to my website dir bin folder selected ajaxcontroltoolkit.dll
-DragDropd toolkitscriptmanager from toolbox under <form runat="server"> in master page
-F5 (build/run) website comes up just fine on my PC
-Used VS2010 ftp CopyWeb feature to move files to Godaddy
-try to go to website "http://www....
-the error below is what is returned.

[TypeInitializationException: The type initializer for 'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception.]
   AjaxControlToolkit.ToolkitScriptManager..ctor() in ToolkitScriptManager.cs:114
   ASP.masterpages_site_master.__BuildControlToolkitScriptManager1() +26
   ASP.masterpages_site_master.__BuildControl__control6() +107
   ASP.masterpages_site_master.__BuildControlTree(masterpages_site_master __ctrl) +181
   ASP.masterpages_site_master.FrameworkInitialize() +22
   System.Web.UI.UserControl.InitializeAsUserControlInternal() +32
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +655
   System.Web.UI.Page.get_Master() +54
   System.Web.UI.Page.ApplyMasterPage() +14
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335
                  


Master Page ---------------------------------------------------

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head runat="server"><title></title><link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /><asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder></head><body><form runat="server"><ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager><div class="page"><div class="header"><div class="title"><h1>
                    My ASP.NET Application</h1></div></div><div class="main"><asp:ContentPlaceHolder ID="MainContent" runat="server"/></div><div class="clear"></div></div></form></body></html>

web.config ---------------------------------------------------  

<?xml version="1.0"?><!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  --><configuration><connectionStrings><add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/></connectionStrings><system.web><customErrors mode="Off"/><compilation debug="true" targetFramework="4.0"><assemblies><add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation><authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880"/></authentication><membership><providers><clear/><add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="hidden"      
</providers></membership><profile><providers><clear/><add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/></providers></profile><roleManager enabled="false"><providers><clear/><add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/><add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/></providers></roleManager><pages><controls><add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/></controls></pages></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true"/></system.webServer><runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4"/></dependentAssembly></assemblyBinding></runtime></configuration>


    Update-------

I got tired of trying to figure it out, so took the easy route, and went back to the last ajax version and it worked fine. Would still like to figure out at a later date, but back up and running now.

Image crop gives error

$
0
0

hello everyone,

i am building the employee portfolio where each employee enteres his/her data. at this stage am I building the image crop where an employee uploads image and then crops it. I am getting this error: Input string was not in a correct format. Could you please advice. thank you.

here is the code: 

{    public partial class Wizard : System.Web.UI.Page    {        String path = HttpContext.Current.Request.PhysicalApplicationPath + "images\\";        protected void Page_Load(object sender, EventArgs e)        {         }         protected void btnUpload_Click(object sender, EventArgs e)        {            Boolean FileOK = false;            Boolean FileSaved = false;             if (Upload.HasFile)            {                Session["WorkingImage"] = Upload.FileName;                String FileExtension = Path.GetExtension(Session["WorkingImage"].ToString()).ToLower();                String[] allowedExtensions = { ".png", ".jpeg", ".jpg", ".gif" };                for (int i = 0; i < allowedExtensions.Length; i++)                {                    if (FileExtension == allowedExtensions[i])                    {                        FileOK = true;                    }                }            }             if (FileOK)            {                try                {                    Upload.PostedFile.SaveAs(path + Session["WorkingImage"]);                    FileSaved = true;                }                catch (Exception ex)                {                    lblError.Text = "File could not be uploaded." + ex.Message.ToString();                    lblError.Visible = true;                    FileSaved = false;                }            }            else            {                lblError.Text = "Cannot accept files of this type.";                lblError.Visible = true;            }             if (FileSaved)            {                pnlUpload.Visible = false;                pnlCrop.Visible = true;                imgCrop.ImageUrl = "images/" + Session["WorkingImage"].ToString();            }        }         protected void btnCrop_Click(object sender, EventArgs e)        {            string ImageName = Session["WorkingImage"].ToString();            int w = Convert.ToInt32(W.Value);  //HERE I AM GETTING THE error: Input string was not in a correct format.            int h = Convert.ToInt32(H.Value);            int x = Convert.ToInt32(X.Value);            int y = Convert.ToInt32(Y.Value);             byte[] CropImage = Crop(path + ImageName, w, h, x, y);            using (MemoryStream ms = new MemoryStream(CropImage, 0, CropImage.Length))            {                ms.Write(CropImage, 0, CropImage.Length);                using (SD.Image CroppedImage = SD.Image.FromStream(ms, true))                {                    string SaveTo = path + "crop" + ImageName;                    CroppedImage.Save(SaveTo, CroppedImage.RawFormat);                    pnlCrop.Visible = false;                    pnlCropped.Visible = true;                    imgCropped.ImageUrl = "images/crop" + ImageName;                }            }        }         static byte[] Crop(string Img, int Width, int Height, int X, int Y)        {            try            {                using (SD.Image OriginalImage = SD.Image.FromFile(Img))                {                    using (SD.Bitmap bmp = new SD.Bitmap(Width, Height))                    {                        bmp.SetResolution(OriginalImage.HorizontalResolution, OriginalImage.VerticalResolution);                        using (SD.Graphics Graphic = SD.Graphics.FromImage(bmp))                        {                            Graphic.SmoothingMode = SmoothingMode.AntiAlias;                            Graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;                            Graphic.PixelOffsetMode = PixelOffsetMode.HighQuality;                            Graphic.DrawImage(OriginalImage, new SD.Rectangle(0, 0, Width, Height), X, Y, Width, Height, SD.GraphicsUnit.Pixel);                            MemoryStream ms = new MemoryStream();                            bmp.Save(ms, OriginalImage.RawFormat);                            return ms.GetBuffer();                        }                    }                }            }            catch (Exception Ex)            {                throw (Ex);            }        }     }
}

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>