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

display whole page and certain position

$
0
0

In a webpage, I have many datalist, where certain complex queries have been return to fetch the data and display datalist in the page load event.

Meanwhile, is there any possiblity display other parts page, as already is a static, rather waiting whole page.

usually manysite, when ever there loadinga new page, certain portion load first and certain portion, you can see rotating wheel image, where data is being loading..

can we have the same approach here.. any ideas.. thanks


error is >>> system.ui.is null

$
0
0

I am trying to get rid of an error comming from the ajax control toolkit the error is >>> system.ui.is null

I tired everything I can think of inculding deleting and re adding the text box and ajaxcontrol, making it null ?

when in debug mode I see this error below

$create(Sys.Extended.UI.DropDownBehavior, {"dynamicServicePath":"/WebApps/QA/input.aspx","id":"txt_LISTING_DATE_DropDownExtende"}, null, null, $get("txt_LISTING_DAT"));

 

Spell check in HTMLEditor

$
0
0

Hi,

I have a Ajaxtoolkit Editor and would like to embed an open-source spell checker. I tried various posts to use TinyMCE Editor, but it seems to not work when I have it in a gridview.

Any insight on how to add spell check feature to the editor control would be very helpful.

<asp:GridView ID="GV_CandDesc" runat="Server" AutoGenerateColumns="False"
                                AutoGenerateEditButton="true" BackColor="White" BorderColor="#DEDFDE"
                                BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="emplid"
                                EnableViewState="True" ForeColor="Black" GridLines="Vertical"
                                OnRowCancelingEdit="CancelCand_descRecord" OnRowCommand="GV_DescRowCommand"
                                OnRowEditing="EditCand_DescRecord" OnRowUpdating="UpdateCand_descRecord"
                                ShowFooter="false" SkinID="RecordList" Width="100%">
                                <Columns>
                                    <asp:TemplateField HeaderText="Comments" ItemStyle-CssClass="infotitle1">
                                        <ItemTemplate>
                                                                                        
                                            <%# DataBinder.Eval(Container.DataItem,"cand_desc") %>
                                            
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                        
                                            <cc1:Editor ID="txtDescComments" runat="server" Content='<%# Bind("cand_desc") %>'/>
                                            
                                                                                        
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    <table ID="NoComm_tbl" style="margin-right: 0px" width="100%">
                                        <tr>
                                            <td class="Span_Title" style="width: 100%">
                                                Comments</td>
                                        </tr>
                                    </table>
                                    <table ID="No_can_desc_tbl" style="margin-right: 0px" width="100%">
                                        <tr>
                                            <td>
                                                <cc1:Editor ID="txtnewDescComment" runat="server" />
                                                        </td>
                                        </tr>
                                        <tr>
                                            <td class="Span_Title" width="100%">
                                                <asp:LinkButton ID="btnDescInsert" runat="server" CommandName="NoDescInsert"
                                                    CssClass="infotitle" Text="Save" />
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:GridView>

Thanks,

System.Web.AspNetHostingPermission - Unblocking AjaxControlToolkit.dll

$
0
0

I downloaded the AjaxControlToolkit, version 3.5.60919 and am using it in my web project.  I published my code and deployed to a web server where I get this error when I go to a page in the website

"Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

I looked at the properties of the DLL and there is a Security section underneath the attributes on the General tab that says:

"This file came from another computer and mightr be blocked to help protect this computer."

There is an Unblock button so if I click it (on file on the web server), the problem goes away.  However, when I publish my project, the DLL gets blocked again.  this DLL is in source control (TFS) and I checked and it is not blocked there.  So this appears to happen only when I am publishing via Visual Studio.

This is getting annoying.  I've never had this issue before.  How can I prevent this from happening?  I don't think I need to manually unblock the file every time I publish.

Problem with data return from json webservice

$
0
0

I'm using jQuery to return data from a webservice.  Done this countless times no problems, till now.

This is the data it's returning

{"results":[{"id":"1","name":"First Last","photo":"/_library/images/000001_First_Last.jpg","title":"I'm working on the new Intranet","details":"<p> Doing a presentation at the RTC&nbsp;Jan 2013&nbsp;Staff meeting.&nbsp; If there are any questions relating to the intranet&nbsp;as we go along please feel free <strong>NOT</strong> to ask any....:) .</p> ","added":"19/Sep/2012"},{"id":"1","name":"First Last","photo":"/_library/images/000001_First_Last.jpg","title":"Just to fill up the scroller","details":"<p> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariaturrd.</p> ","added":"19/Sep/2012"}]}

But for some reason the javascript is just not running

function WhatIsHappening() {
        if ($("#whatsHappening").length <= 0) return;

        var filter = "{'deptId':'" + $("[id$=txtUserDeptID]").val() + "'}";$.ajax({
            type: "POST",
            url: "/_assets/webservices/WSWhatsHappening.asmx/Init",
            data: filter,
            ifModified: true,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            dataFilter: function (data) {
                var msg = eval('(' + data + ')');
                if (msg.hasOwnProperty('d'))
                    return msg.d;
                else
                    return msg;
            },
            success: function (msg) {
                var s;
                var link = "";
                var recCount = msg.results.length;

                if (recCount > 0) {$("#whatsHappening .scrollingtext").text("");
                    for (each in msg.results) {
                        if (each != "undefined") {
                            s = msg.results[each];

                            link += "<div>";
                            //build the output
                            link += "<img src=\"" + s.photo + "\" alt=\"" + s.name + "\" />";
                            link += "<h3><a href='/staff/details/id/" + s.id + "'>" + s.name + "</a> is currently:-</h3>";
                            link += "<strong>" + s.title + "</strong>";
                            link += s.details;
                            link += "<p>Added: " + s.added + "</p>";
                            link += "</div>";
                        }
                    }
                    alert(link);$("#whatsHappening .scrollingtext").append(link);
                } else {$("#whatsHappening .scrollingtext").append("<h2>All quiet!!</h2><strong>Looks like no-one is doing anything at the minute, why not be the first to <a href=\"/personal/wh_details.aspx\">add</a> something.</strong>");
                }
            },
            complete: function (xml, status) {
                if (status != "success") {$("#whatsHappening .scrollingtext").hide();
                }
            },
            failure: function (fail) {
                alert("FAILED:" + fail);
            },
            error: function (err) {
                alert("No matches found!\n" + err.status + "(" + err.statusText + ")\n" + err.responseText);
            }
        });
    }

I can put an alert(msg.d) just after

var msg = eval('(' + data + ')'); 

and it gives me the data that I would expect, I'm sure its the s.details that is causing the problem.  If I just return "" in the webservice instead of the actual data for that field it works, but I cannot see anything wrong with the returned data.

Repeater not triggering DataBinding event from IAsyncResult callback method

$
0
0

I'm trying to update an asp repeater from a REST call.  My web request has a callback method that binds the results to the repeater.  When I do bind the data the repeater doens't update nor do the repeater events fire.  Here is my code to provide some context.

Thanks for any help in advance.

<asp:UpdatePanel runat="server" ID="connectFeedUP" UpdateMode="Conditional"><Triggers><asp:AsyncPostBackTrigger ControlID="rptConnectFeed" /></Triggers><ContentTemplate><asp:Repeater runat="server" ID="rptConnectFeed" OnItemDataBound="rptConnectFeed_OnItemBound" ><HeaderTemplate><ul class="ConnectStoryArea"></HeaderTemplate><ItemTemplate><li class="ConnectStory"><div class="ConnectStoryTitle"><a href="<%# Eval("URL")%>"><%# Eval("Subject")%></a></div><div class="ConnectStoryContentInfoArea"><div class="ConnectStoryAuthor"><%# Eval("Author")%></div><div class="ConnectStoryDate"><%# Eval("Date")%></div></div><div class="ConnectStoryContent"><%# Eval("Content") %></div></li></ItemTemplate><FooterTemplate></ul></FooterTemplate></asp:Repeater></ContentTemplate></asp:UpdatePanel>

private void DiscussionWebCall()
{
    Uri address = new Uri("https://domain.com");

    HttpWebRequest request = (WebRequest.Create(address)) as HttpWebRequest;
    NetworkCredential netCreds = new NetworkCredential("xxxxxxx", "xxxxx");

    if (netCreds != null)
    {
        string authInfo = ((netCreds.Domain != null) && (netCreds.Domain.Length > 0) ? netCreds.Domain + @"\" : string.Empty) +
         netCreds.UserName + ":" + netCreds.Password;
         authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
         request.Headers["Authorization"] = "Basic " + authInfo;
    }
    request.BeginGetResponse(ResponseCallback, request);
}

private void ResponseCallback(IAsyncResult ar)
{
    var request = (HttpWebRequest)ar.AsyncState;
    var response = request.EndGetResponse(ar);
    IEnumerable<ConnectDiscussion> discussions;

    using (var stream = response.GetResponseStream())
    using (var reader = new StreamReader(stream))
    {
        var contents = reader.ReadToEnd();
        string json = contents.Remove(0, contents.IndexOf('{'));

        JObject jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json) as JObject;
        JArray jaDiscussions = (JArray)jsonObj["list"];

        //IList<string> joDiscussions = jaDiscussions.Select(c => (string)c["published"]).ToList();
        discussions = from d in jaDiscussions
                        select (new ConnectDiscussion()
                        {
                            Author = (string)d["author"]["displayName"],
                            URL = (string)d["resources"]["html"]["ref"],
                            Content = (string)d["content"]["text"],
                            Subject = (string)d["subject"],
                            Date = (DateTime)d["published"]
                        });
    }

    rptConnectFeed.DataSource = discussions.ToList();
    rptConnectFeed.DataBind();
}



TinyMCE editor in gridview control

$
0
0

Hello All,

I have a gridview and am using TinyMCE control inside it. I came to know that TinyMCE doesn't work well with Updatepanel. I tried adding the control in page load as suggested here http://www.tinymce.com/forum/viewtopic.php?id=6034

However, it doesn't work. The problem being, it doesn't recognize the text box.

<script src="tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
    
<script type="text/javascript">
       tinyMCE.init({ mode: "textareas", theme: "advanced" });
       function InitTiny() { tinyMCE.execCommand('mceAddControl', false, 'ctl00_body_content_txtDescComments'); }   
    </script>   

<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:GridView ID="GV_CandDesc" runat="Server" AutoGenerateColumns="False"
                                AutoGenerateEditButton="true" BackColor="White" BorderColor="#DEDFDE"
                                BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="emplid"
                                EnableViewState="True" ForeColor="Black" GridLines="Vertical"
                                OnRowCancelingEdit="CancelCand_descRecord" OnRowCommand="GV_DescRowCommand"
                                OnRowEditing="EditCand_DescRecord" OnRowUpdating="UpdateCand_descRecord"
                                ShowFooter="false" SkinID="RecordList" Width="100%">
                                <Columns>
                                    <asp:TemplateField HeaderText="Comments" ItemStyle-CssClass="infotitle1">
                                        <ItemTemplate>
                                                                                        
                                            <%# DataBinder.Eval(Container.DataItem,"cand_desc") %>
                                            
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                        <%--<img id="Word" runat="server" src='../images/Word.jpg' title="Spellcheck" onclick="javascript: CheckSpelling();" />
                                        <i>(Click to check spelling)</i>
                                            <cc1:Editor ID="txtDescComments" runat="server" Content='<%# Bind("cand_desc") %>'/>--%>
                                           <asp:TextBox ID="txtDescComments" runat="server"
                                           Height="100" TextMode="MultiLine"  
                                           Width="400" Text='<%# Bind("cand_desc") %>' />
                                           
                                                                                      
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                
                            </asp:GridView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    

Any help would be very appreciated. I have tried to work a solution for the past whole week

Ajax pop up disappears instantly while partial postback

$
0
0

Dear All,

I am using ajax popup extender to show the confirmation message for editing the row in gridview. But the pop up opens and disappear instantly.

Following is the code

<script type="text/javascript" language="javascript">
    function showModel() {
            $find('editConfirm').show();
        }
        function onOk() {
        return true; }</script><asp:Button ID="btnnoshow" runat="server" Style="display: none" meta:resourcekey="btnnoshowResource1" /><ajaxToolkit:ModalPopupExtender ID="modalAddLang" runat="server" PopupControlID="pnladdLang"
        BackgroundCssClass="modalBackground" TargetControlID="btnnoshow" RepositionMode="RepositionOnWindowScroll"></ajaxToolkit:ModalPopupExtender><asp:Panel ID="pnladdLang" runat="server" Style="display: none;" CssClass="modalPopup"
        meta:resourcekey="pnladdLangResource1"><asp:UpdatePanel ID="UpdatePanel11" runat="server"><ContentTemplate><table width="100%" border="0" cellpadding="0" cellspacing="10"><tr><td><asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="DESC_ID,LCID"
                                            OnRowCommand="GridView2_RowCommand" OnRowCancelingEdit="GridView2_RowCancelingEdit"
                                            OnRowDeleting="GridView2_RowDeleting" OnRowEditing="GridView2_RowEditing" OnRowUpdating="GridView2_RowUpdating"
                                            OnRowDataBound="GridView2_RowDataBound" BorderWidth="0px" BorderStyle="None"
                                            GridLines="None" Width="100%" meta:resourcekey="GridView2Resource1"><Columns><asp:TemplateField HeaderText="Business Description" meta:resourcekey="TemplateFieldResource1"><EditItemTemplate><asp:Label ID="lblcnt2" runat="server" Text="" ForeColor="Cyan"></asp:Label>&nbsp;<asp:Label ID="lblgrddetails" runat="server" Text="Characters remaining" meta:resourcekey="Label3Resource1"></asp:Label><br /><asp:TextBox ID="edtBizdesc" runat="server" TextMode="MultiLine" Height="80px" Width="200px"
                                                            Text='<%# Bind("DESC_TXT") %>' onkeypress="return textboxMultilineMaxNumber(event, this,300);"
                                                            onKeyUp="Count2(this, 300);" onChange="Count2(this,300);" MaxLength="300" meta:resourcekey="edtBizdescResource1"></asp:TextBox><div><asp:RequiredFieldValidator runat="server" ID="rfvaldesc1" ControlToValidate="edtBizdesc"
                                                                Display="Dynamic" ErrorMessage="Business description is required" ValidationGroup="EditGroup"
                                                                CssClass="errortext" meta:resourcekey="rfvaldesc1Resource1"></asp:RequiredFieldValidator><asp:RegularExpressionValidator runat="server" ID="RgDescriptionlngedit" ValidationExpression="[\s\S]{0,300}"
                                                                ValidationGroup="EditGroup" Display="Dynamic" ErrorMessage="Maximum 300 characters allowed"
                                                                ControlToValidate="edtBizdesc" CssClass="errortext" meta:resourcekey="RgDescriptionlngeditResource1"></asp:RegularExpressionValidator></div></EditItemTemplate><ItemTemplate><asp:TextBox ID="Bizdesc" runat="server" Height="80px" ReadOnly="True" Text='<%# Eval("DESC_TXT") %>'
                                                            TextMode="MultiLine" Width="200px" meta:resourcekey="BizdescResource2"></asp:TextBox></ItemTemplate><HeaderStyle CssClass="table1header" /><ItemStyle CssClass="tableborder5" /></asp:TemplateField><asp:TemplateField HeaderText="Language" meta:resourcekey="TemplateFieldResource2"><%--<EditItemTemplate><asp:DropDownList ID="edtddlLang" runat="server" meta:resourcekey="edtddlLangResource1"></asp:DropDownList></EditItemTemplate> --%><ItemTemplate><asp:Label ID="lblLang" runat="server" Text='<%# Eval("LANG") %>' meta:resourcekey="lblLangResource1"></asp:Label><asp:HiddenField runat="server" ID="hfnLcid" Value='<%# Eval("LCID") %>' /></ItemTemplate><HeaderStyle CssClass="table1header" /><ItemStyle CssClass="tableborder5" /></asp:TemplateField><asp:TemplateField HeaderText="Edit" ShowHeader="False" meta:resourcekey="TemplateFieldResource3"><EditItemTemplate><asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" Text="Update"
                                                            ValidationGroup="EditGroup" meta:resourcekey="LinkButton1Resource1"></asp:LinkButton><asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                                            Text="Cancel" meta:resourcekey="LinkButton2Resource1"></asp:LinkButton></EditItemTemplate><ItemTemplate><asp:LinkButton ID="lnkEdit1" runat="server" CommandName="Edit" CausesValidation="False"
                                                            Text="Edit" OnClientClick="showModel();"  meta:resourcekey="lnkEdit1Resource1"></asp:LinkButton></ItemTemplate><HeaderStyle CssClass="table1header" /><ItemStyle CssClass="tableborder5" /></asp:TemplateField><asp:TemplateField HeaderText="Delete" ShowHeader="False" meta:resourcekey="TemplateFieldResource4"><ItemTemplate><asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                            Text="Delete"  OnClientClick="showDeleteModel();"  meta:resourcekey="lnkDeleteResource1"></asp:LinkButton></ItemTemplate><HeaderStyle CssClass="table1header" /><ItemStyle CssClass="tableborder5" /></asp:TemplateField></Columns></asp:GridView></td></tr><tr><td align="right" valign="middle"><asp:Button ID="btnfinish" runat="server" Text="Finish" CssClass="button" OnClick="btnfinish_Click"
                                            CausesValidation="False" meta:resourcekey="btnfinishResource1" /></td></tr></table></ContentTemplate><Triggers><asp:PostBackTrigger ControlID="btnfinish" /><asp:PostBackTrigger ControlID="LinkButton4" /><asp:PostBackTrigger ControlID="GridView2" /></Triggers></asp:UpdatePanel></asp:Panel><asp:Button ID="cmdokEdit" runat="server" Style="display: none"/><ajaxToolkit:ModalPopupExtender ID="editConfirm" runat="server" BackgroundCssClass="modalBackground"
     PopupControlID="Panel1" TargetControlID="cmdokEdit"  BehaviorID="editConfirm" OkControlID="OkButton"  CancelControlID="CancelButton" ></ajaxToolkit:ModalPopupExtender><asp:Panel ID="Panel1" runat="server" Style="display: none;" CssClass="modalPopup"><asp:UpdatePanel ID="UpdatePaneedit" runat="server"><ContentTemplate><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="left" valign="middle" class="popupheader"><asp:Label ID="Label15" runat="server" Text="Business Description" meta:resourcekey="lblheadertxtResource1"></asp:Label></td>   </tr><tr><td><asp:Label ID="lbleditmessage" runat="server" Text="Do you want to edit the record?"></asp:Label></td></tr><tr><td><asp:Button ID="OkButton" runat="server" CssClass="button" Text="OK"></asp:Button><asp:Button ID="CancelButton" runat="server" CssClass="button" Text="Cancel"></asp:Button></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Panel>

Please help me.


AJAX NumericUpDownExtender - Disable Manual Entry / Validation

$
0
0

Hi there,

This is a pretty straight-forward question, which I'm sure has a very easy answer that I'm just missing.

I have a textbox with an up/down control, with a minimum of 0 and maximum of 30. Currently, you can also put the cursor into the textbox and type in a value, so I also put in a FilteredTextBoxExtender that will ensure that only numbers can be entered.

It works exactly as advertised, except that it allows the user to enter number less than 0 and more than 30 if they put the cursor into the textbox and type it in.

Is there an easy way to keep the functionality that allows the user to manually edit the box, but ensure that if you type in a number like "200", that it resets it to 30?

I'm hoping there's a pre-existing, built-in solution, without me having to manually add some javascript code.


Plan B:

I'd rather not have to disable the textbox from user input, but if the above isn't possible, how do I do that and still maintain the up/down functionality? (The samples on the AJAX site work this way, but the setting to disable manual entry must be burried somewhere in the code, because I did a quick scan and couldn't find it.)


Thanks,

Aania

change display name of AJAX CALNDAREXTENDER months

$
0
0

Can I change the display name of AJAX CALENDAR EXTENDER months without changing he language or culture of the page? in vb.net.

For example: i want to display "1" instead of Jan

thanx in advance..

General How to Use AJAX

$
0
0

I built some "ajax" functions using native javascript in 2006 using VS2005; basically a "core" callback send and receive script (shown below) and then a callback sender and receive router in js, and a callback receive router and replier in vb.   There are over a dozen miscellaneous functions that send and receive between client and server through these "utilities", all works fine.

Now I'm refreshing the application using VS2010 Express and trying to figure out how I might better use contemporary AJAX capabilities.  Here's the first question:

1)  How might I replace this "core" callback and receive script with something that's pre-written from the VS2010 AJAX (or other) library?

Any help with this would be appreciated.

Thanks!

<%-- =====================================================
=======================CALLBACK ROUTINES=============== --%>
<script type="text/javascript">

function CallBackClientSender(varDataString) {
clearTimeout( gvPrompterTimeout)
//alert("at callback sender")
var Command = varDataString;
var context = new Object();
// <050907>
if (gvCallBackInProgress) {
return false
} // <050907>
gvCallBackInProgress = true // <050907>
context.CommandName = "CallBackClientSender";
<%=CallBackSenderSetupString%>
return
}

function CallBackClientReceiver(varCallBackResult, varContext) {
//alert("at callback receiver")
if (varContext.CommandName == "CallBackClientSender" ) {
//alert("calling client-side router")
gvCallBackInProgress = false // <050907>
CallAndPostBackRouter(varCallBackResult)
return
}
}

function onError(message, context) { // This will occur if there's an exception from the server side
CallBackErrorProcessing(message) } // message will be the exception message

</script>

 

Ajax tool kit

$
0
0

Hey friends,

anyone please tell me ajax tool kit control examples. as i using this but unable to get exact information. anyone tell me tool kit example with code

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite

MaskedEditExtender problem in Google Chrome: Delete and Backspace keys don't work

$
0
0

When I use the MaskedEditExtender on a TextBox, the delete and backspace keys don't work in Chrome.

This is my code:

<asp:TextBox ID="wsDateBox" runat="server" MaxLength="10" Style="width: 70px;"></asp:TextBox><ajaxToolkit:MaskedEditExtender ID="wsMaskedDateExtender" runat="server" TargetControlID="wsDateBox"
    Mask="99-99-9999" MaskType="None" ClearMaskOnLostFocus="false" UserDateFormat="DayMonthYear"></ajaxToolkit:MaskedEditExtender>

Am I doing something wrong?


How to insert new images to page without refresh

$
0
0

Hello
I have a gallery page which get images location url from DB and bind it to repeater.
The images can be added to gallery anytime.
Now lets say a user visit my gallery page, and after 2-3 minutes new images has been added on DB.
How can I make this images to appear on the user page without refreshing the entire page?
should I use UpdatePanel? and if so how can I trigger the updatePanel to check for new images every N minutes?
Thanks!!

Ajax Update panel

$
0
0

Hi,

I am using ajax update panel to get total of 6 textboxes in one other textbox.

I placed Total's textbox under updatepanel & added <asynchronouspostback ......> in triggers for 6 textboxes.

But when asynchonous postback causes for 1st textbox if i enter value in next textboxes , It gets cleared as that asynchonous postback gets completed.

Is there any solution for this?

Priya


Inspiration need please

$
0
0

Hi

I have an app that needs to send automatic emails when a formview updates. No problem there, but I need to present the email content to the user as the formview is updating, ask them to check it, edit it if necessary and then send it. There could also be more than one email per formview updating.

Is a modal best for this and how do I pause the formview update as I display the modal(s)? They could be open for a few minutes.

Let me know if this doesnt make sense.

 

Thanks

 

Leonaisse

 

Cascade Dropdown list and browser back button.

$
0
0

Hi, 

I am using ajax cascade dropdown lists for master and child loads. Also i have given user to use IE back button so that user can browse previous state.

I have list page wher user has selected an item from ddl A and based on which ddl B is populated. Now user press Search button and then based on selected values a list (gridview) is populated. Now user select one of rows from the list and view the details in a detail page. Now user wants to come back using IE back button. When user clicks on back button, the dropdown lists do not get populated properly and gives   ajax error.

So how to solve this problem. I have many pages like this. Anyone has any idea?

Slideshow with images from database (image data type)

$
0
0

Hello,

I'm trying to create a slideshow using Ajaxcontroltoolkit with images already stored in a database. To retrieve those images I'm using a handler.

Here is the code of the handler file (C#) :

<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;


public class Handler : IHttpHandler {

    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connStr"].ConnectionString);
    public void ProcessRequest (HttpContext context)
    {
        string imgID = context.Request.QueryString["ID"].ToString();
        SqlCommand cmd = new SqlCommand("SELECT * from picture where id_picture=" + imgID, conn);
        conn.Open();

        SqlDataReader Dr = cmd.ExecuteReader();

        Dr.Read();

        context.Response.BinaryWrite((byte[])Dr["picture"]);
        conn.Close();
    }
    public bool IsReusable {
        get {
            return false;
        }
    }

}

Here is the part of the page for displaying the slideshow .aspx :

<asp:ToolkitScriptManager
    ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Medium" />  <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Medium" />  <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Medium" /> <asp:Image ID="Image2" runat="server" Height="200px" Width="315px" /><asp:SlideShowExtender ID="Image1_SlideShowExtender" runat="server" 
            TargetControlID="Image2"  
            SlideShowServiceMethod="GetSlides" 
            SlideShowServicePath="WebService.asmx" 
            PreviousButtonID="Button1" 
            PlayButtonID="Button2"  
            NextButtonID="Button3"  
            PlayButtonText="Play" 
            StopButtonText="Stop"  
            AutoPlay="true"  
            Loop="true"></asp:SlideShowExtender>

My problem is with the WebService.asmx file. I don't really know what to write. I already tried several things but it didn't work (no images appeared). I insist that all my images are stored as an image data type in SQL!

Here is the extract of the WebService :

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]

public AjaxControlToolkit.Slide[] GetSlides()  
{
    
    ?

    return slides;
}


I'd be verygrateful if someone couldhelp me !

Best regards

Use of Update Panel

$
0
0

I've got an application with a lot of callback functionality, that I'm hoping to upgrade to formal AJAX controls.   in another question, I asked about using ScriptManager instead of my raw javascript callback code.  Assuming I get that set up, here's the next question:

I think I understand the general idea of the Update Panel, however, before I go in that direction, I was hoping to get some input on this.

One of the panels on my main application page is a dynamic, drag-and-drop diagram that can contain scores of elements.  There is a large body of code in the page codebehind and supporting code files that maintains and updates this diagram based on a variety of GUI actions.    

All of this code ends up adding the many diagram element controls (image buttons, images, divs) into the primary diagram panel, during the main page PageLoad.  So at each page refresh, the new diagram changes are registered in the database and rewritten to the screen.  I want to have the diagram changes done and updated to the DB without the page load, i.e. through callback/AJAX.

If I were to take the parent panel for this diagram, and change it to an AJAX update panel (with the appropriate triggers and wiring), could I expect it to do an AJAX-type update, even though it has all this complex diagram-type content?  In other words, does the update panel not care that controls have been dynamically added to it, it will just do the AJAX type update regardless?  Or might there be any other issues with using an update panel in this situation?

Any guidance on this would be appreciated.

Thanks!

Why User Update Panel instead of Home Grown Callbacks?

$
0
0

I'm looking at a major change in coding strategy and am hoping for some opinions.  Partly I'm writing this to force myself to think it through.  But input would be appreciated.

The central question is whether to continue with my home grow AJAX or convert (at least in part) to UpdatePanels.

The app in question has its primary functionality on single "Main Page" where people stay and do collaboration using different panels (review, discuss, control, help, etc).   Right now all these panels rely on full postback.  For context, this app is intended to be prototype that hopefully I could stretch to light SAS service with a limited audience (and maybe further, who knows) until I can attract a development partner.   I've already run it in that limited audience scenario on an ISP for a brief time, but it's never been really pounded on.

Re the homegrown AJAX:  for certain control function the app uses a set of callback utilities I built using native javascript in 2006 using VS2005; basically a main callback send and receive script and then a callback sender and receive router in js, and a callback receive router and replier in codebehind.   There are over a dozen miscellaneous functions that send and receive between client and server through these utilities.  In some cases I build whole popup menus in codebehind, convert them to raw html and send them the client as callback replies where the html is reinstantiated as a div.  All works fine, which is to say, I'm reasonably comfortable with this technology.

Now I'm thinking about converting the panels to use ajax/callbacks.   If I did it using my home grown utilities, I would use the existing panel build functions in codebehind and then treat them like the callback popup menu described above.

Re the UpdatePanel alternative:  one of the panels on my main application page is a dynamic, drag-and-drop diagram that can contain scores of elements.  The codebehind for this dynamically adds a bunch of controls (div, images, labels) to a div and then reposts.  I've validated (with help from CruzerB @ http://forums.asp.net/t/1878128.aspx and some prototyping) that I can likely convert this functionality to use an UpdatePanel and related technology.   All the content on the diagram is saved to a DB and refreshes with each postback so there's not an issue with losing dynamically added controls.

I would similarly use UpdatePanels for six other such panels, which contain gridviews and/or miscellaneous sets of controls.

In terms of UpdatePanel performance, there's not a huge amount of volume in any of these panels.  A gridview with 100 items, and a diagram with 100 elements would be about normal, 500 each would be rare, at least for the majority of early adopter users. After that it's a different problem in terms of business and technology architecture.

Maybe the UpdatePanel approach is much more robust and maintainable, adding to the lifetime of the prototype.

Maybe there's better security and error handing available with the UpdatePanel.

Comparing the two approaches, I'm not sure how much conversion would be required.
1) I would have to build a control function in Javascript to decide which panel reloads to trigger in any case, based on user actions, instead just using postbacks in every case.  
2) Right now the panels are built in codebehind during PageLoad.   There might be certain conditions under which not ALL the panels would be updated on each PageLoad, so I might have to change the main page load logic to account for that.  That might be needed with both the homegrown ajax approach or the update panels.
3) In the homegrown I would definitely have to build routines to convert the panels to and reconstitute the panels from strings, but I can copy techniques I've already written for that.
4) ? 

Given all that, again, I was hoping for some feedback, advice, opinions, on what other factors should I be considering in terms of whether to use my homegrown AJAX versus update panels, and which approach might be better for different reasons.

Any help with this would be appreciated.

Thanks!

Viewing all 5678 articles
Browse latest View live


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