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

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"));

 


Model Popup extender

$
0
0

Hello friends,

kindly tell me how can we open aspx page in modelpopup ajax control.

Integrate asp.net webpage with user control in Master Page

$
0
0

I am tring to intergrate a asp.net web page with a user control in a master page. My problem is when i am running my asp.net webpage with user control on it, it  is running fine, but as i am placing the webpage inside the Master Page, the Extender controls like AutoCompleteExtender,PopupControlExtender   placed inside the user control are  not working. I also have placed ScriptManager  tag in my Master Page.

Hence my problem is how to integrate asp.net webpage with user control in Master Page. And the User Control consist of Auto Complete Textbox, a Checkbox list with a textbox etc.

For referance i am posting the code of the User Control.

Code of User Control:-

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><table width="46%" border="0" cellspacing="0" cellpadding="0"><tr><td width="47%">&nbsp;</td><td width="2%">&nbsp;</td><td width="51%">&nbsp;</td></tr><tr><td>
            NEW&nbsp; ID</td><td>&nbsp;</td><td rowspan="6" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="right"><asp:Panel ID="pan1" runat="server" Height="200px" ScrollBars="Auto"><asp:GridView AutoGenerateColumns="false" CellPadding="4" ID="GrdView" runat="server"
                                Height="50px" ForeColor="#333333" Width="231px" OnRowDeleting="OnRowDeleting"
                                OnRowDataBound="OnRowDataBound"><Columns><asp:CommandField ShowDeleteButton="True" ButtonType="Button" /><asp:BoundField DataField="NEW_ID" HeaderText="NEW ID" SortExpression="NEW_ID" /><asp:BoundField DataField="OLD_ID" HeaderText="OLD ID" SortExpression="OLD_ID" /></Columns><FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /><PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /><SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /><HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /><EditRowStyle BackColor="#999999" /><AlternatingRowStyle BackColor="White" ForeColor="#284775" /><AlternatingRowStyle BackColor="#F7F6F3" /></asp:GridView></asp:Panel></td></tr></table></td></tr><tr><td><asp:TextBox runat="server" ID="txtAutoComp" Width="250" autocomplete="off" /><div id="divwidth"></div><cc1:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete1"
                TargetControlID="txtAutoComp" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList"
                MinimumPrefixLength="2" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20"
                CompletionListElementID="divwidth" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true" OnClientHiding="OnClientCompleted"
                OnClientPopulated="OnClientCompleted" OnClientPopulating="OnClientPopulating"></cc1:AutoCompleteExtender></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td align="left"><asp:Button ID="btnAddRecord" runat="server" Text=">>>" OnClick="btnAddRecord_Click" /></tr><tr><td>
            OLD ID</td><td>&nbsp;</td></tr><tr><td><asp:TextBox ID="txtCombo" runat="server" Width="200" Font-Size="X-Small"></asp:TextBox><cc1:PopupControlExtender ID="PopupControlExtender111" runat="server" TargetControlID="txtCombo"
                PopupControlID="Panel111" Position="Bottom"></cc1:PopupControlExtender><input type="hidden" name="hidVal" id="hidVal" runat="server" /><asp:Panel ID="Panel111" runat="server" ScrollBars="Vertical" Width="250" Height="150"
                BackColor="AliceBlue" BorderColor="Gray" BorderWidth="1"><asp:CheckBoxList ID="chkList" runat="server" Height="150" onclick="CheckItem(this)"></asp:CheckBoxList></asp:Panel></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnAddRecord" /></Triggers></asp:UpdatePanel>

Thanx in advance.

Dipak

 

Get Client Time on TimerTick

$
0
0

Hi,

I have a web page with ajax timer. What I want to do is to get the client time on every timer tick.

I've managed to show the time in a client side label using a javascript function but I can't get the time in the server side.

Someone know how to do this?

AsyncFileUpload do not upload in update panel if update panel contents are initially invisible but now visible

$
0
0

Scenario is something like this

i have an update panel which have a panel control and there are some controls in panel control. when page is loaded pane is invisible....AsyncFileUpload is also in this panel control....when user click on add button on page this update panel is asynchronously updated and panel control is made visible which in turn make all child controls visible

now if i select file in AsyncFileUpload it do not upload file...but if this panel is visible in first page load it works fine


any help on issue?

Ajax is not working after few random drop down select and textbox text type

$
0
0

Dear Expert,

I have created very simple application to select some data from dropdown and next to type and add in dropdown item. Without ajax exerything fine and never receive any problem with these code. But problem happening if I set these control in UpdatePanel (ScriptManager in page but control outside UpdatePanel then no problem). When I am selection these dropdown randomly (these are auto post back enable and casecase dropdown type) after 3-4 selection of dropdown nothing is happening. I have tested in debug mode these are firing postback event. However same thign never creating problem for nonajax code.

Any idea why happening? I have taken correct AjaxToolkit DLL.

Thanks in advance

Suman

is not a foreign key column and cannot be used here

$
0
0

I'm a newbie at linq, Ajax and c#. I am not new to SQL Server, or VB. I am getting the error:

'ReportTypeID' is not a foreign key column and cannot be used here.
As far as I can tell, it is correctly configured to handle the foreign key.

The two tables are configured as follows:

CREATE TABLE [dbo].[Report](
[Id] [INT] IDENTITY(1,1) NOT NULL,
[ReportTypeID] [INT] NOT NULL,
CONSTRAINT [PK_Report] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Report] ADD CONSTRAINT [DF_Report_ReportTypeID] DEFAULT ((1)) FOR [ReportTypeID]
GO
ALTER TABLE [dbo].[Report] WITH CHECK ADD CONSTRAINT [FK_Report_ReportType] FOREIGN KEY([ReportTypeID])
REFERENCES [dbo].[ReportType] ([TypeValue])
GO
ALTER TABLE [dbo].[Report] CHECK CONSTRAINT [FK_Report_ReportType]
GO
CREATE TABLE [dbo].[ReportType](
[TypeValue] [INT] NOT NULL,
[TypeDescr] [VARCHAR](50) NOT NULL,
CONSTRAINT [PK_ReportType] PRIMARY KEY CLUSTERED
(
[TypeValue] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

The SQL join is as follows:

SELECT * FROM Report r INNER JOIN ReportType rt ON r.ReportTypeID = rt.TypeValue

Finally, the C# dbml definitions on the appropriate columns (much attenuated) are as follows:

<Table Name="dbo.Report" Member="Reports"><Type Name="Report"><Column Name="ReportTypeID" Type="System.Int32" DbType="INT NOT NULL" CanBeNull="false" /><Association Name="ReportType_Report" Member="ReportType" ThisKey="ReportTypeID" OtherKey="TypeValue" Type="ReportType" IsForeignKey="true" /></Type></Table><Table Name="dbo.ReportType" Member="ReportTypes"><Type Name="ReportType"><Column Name="TypeValue" Type="System.Int32" DbType="INT NOT NULL" IsPrimaryKey="true" CanBeNull="false" /><Association Name="ReportType_Report" Member="Reports" ThisKey="TypeValue" OtherKey="ReportTypeID" Type="Report" /></Type></Table>

The SQL works correctly and there are no dis-joins in the data, the data is correct when I step through the program.
The value of the ReportTypeID=1 which is valid.
The TypeValue in the ReportType table is not auto generated, it is unique and a primary key.

The error is reported in the Ajax field template code "ForeignKeyRequired_Edit.ascx.cs"

protected override void OnDataBinding(EventArgs e)
{
  base.OnDataBinding(e);

  if (Mode == DataBoundControlMode.Edit)
  {
    string foreignkey = ForeignKeyColumn.GetForeignKeyString(Row); // Error On This Line
    ListItem item = DropDownList1.Items.FindByValue(foreignkey);
    if (item != null)
    {
      DropDownList1.SelectedValue = foreignkey;
    }
  }
}

There is a switch statement in the code that requires editing. I'm getting to my template, but not to my field.

case "Source": // This Works
  items = StaticCache.Sources.AsQueryable().Where(att.WhereClause).Select(r => new ListItem { Text = r.Name, Value = r.Id.ToString() }).ToArray();
  break;
// Problem Code - This One Doesn't Work - It Never Gets Here. The Loop that is supposed to pick up this statement has a null definition of the table.
case "ReportTypeTable": // Based On The Table Definition -- Internal Doc Points To This One
  items = StaticCache.ReportTypes.AsQueryable().Where(att.WhereClause).Select(r => new ListItem { Text = r.TypeDescr, Value = r.TypeValue.ToString() }).ToArray();
  break;

I suspect this has something to do with the dbml definitions. I am still definitely missing something.

See http://stackoverflow.com/questions/14409788/is-not-a-foreign-key-column-and-cannot-be-used-here for some discussion.











Cannot refresh parent from modal popup

$
0
0

I have a modal popup and I have search every single example that i can find but I am unable to refresh my parent screen. Any ideas?


ajax combo box

$
0
0

Hello in my project I  have 3 ajax combo boxes. I would like them to kind of work like ajax cascading dropdown, except I would like the user to be able to choose from any of the combo boxes and then the options of the other 2 combo boxes are changed accordingly. They will all be linked by CUST_NO . Any suggestions ?

Thanks!

JO

Accordion databind to sitemap (three levels accordion menu)

$
0
0

 I can not implement the three levels, my menu has the following schema


Item A
     Item A.1
        Item A.1.1
        Item A.1.2
      Item A.2
        Item A.2.1
        Item A.2.2
Item B
      Item B.1
        Item B.1.1
        Item B.1.2
      Item B.2
        Item B.2.1
        Item B.2.2

Item C
     Item C.1
        Item C.1.1
        Item C.1.2
      Item C.2
        Item C.2.1
        Item C.2.2

and I have implemented a sitemap AspNetSqlSiteMapProvider to recover, I'm desperate, took several days, and I'm a beginner, thanks in advance for any help

Cannot get Reorderlist to reorder

$
0
0

Hello everyone,

I am trying to generate a test Reorderlist for use with another application.  My code compiles and provides output from a test table I have in MySQL just fine.  However, none of the rows can be dragged like they are supposed to.  It just simply shows the results and does not allow me to drag and drop the rows so I can reorder them.  I know I am close to getting this working, but I am sure it is something simple I as missing here.  Below, I am enclosing my ASP content file and my Site Master file.

I am running the AjaxToolKit version 4.1.60501.  This toolkit has worked great with all of my other Ajax ASP sites.

Can someone please help me?  Thank you in advance!

//ASPX file:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VehicleSeqMgmt.aspx.cs" Inherits="VehicleSequencing.VehicleSeq" MasterPageFile="~/Site.master" %><asp:content id="Content1" contentplaceholderid="MainContent" runat="server">
   Welcome!<ajaxToolkit:ScriptManager ID="ScriptManager1" runat="server"></ajaxToolkit:ScriptManager><asp:SqlDataSource ID="sds1" runat="server" ProviderName="System.Data.Odbc" ConnectionString="<%$ ConnectionStrings:QSYS566%>" SelectCommand="select * from test1" /><ajaxToolkit:ReorderList ID="VehicleSeqList" runat="server"
    DataSourceID="sds1"
    DragHandleAlignment="Left"
    ItemInsertLocation="Beginning"
    DataKeyField="id"
    SortOrderField="Priority"
    PostBackOnReorder="false"
    CallbackCssStyle="callbackStyle"
    AllowReorder="true"><ReorderTemplate><asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" /></ReorderTemplate><DragHandleTemplate> <div class="DragHandleClass"> </div>  </DragHandleTemplate><ItemTemplate><div class="itemArea"><asp:Label ID="Label1" runat="server"
                    Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("id"))) %>' /></div><asp:Label ID="ItemLabel" runat="server" Text='<%#HttpUtility.HtmlEncode(Convert.ToString(Eval("Description"))) %>' /></ItemTemplate><EditItemTemplate><div class="itemArea"><asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ID") %>' ValidationGroup="edit" /><asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Description") %>' ValidationGroup="edit" /></div></EditItemTemplate><ReorderTemplate><asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" /></ReorderTemplate><InsertItemTemplate><div style="padding-left:25px; border-bottom:thin solid transparent;"><asp:Panel ID="panel1" runat="server" DefaultButton="Button1"><asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ID") %>' ValidationGroup="add" /><asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Add" ValidationGroup="add" /><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="add"
                                ErrorMessage="Please enter some text" ControlToValidate="TextBox1" /></asp:Panel></div></InsertItemTemplate></ajaxToolkit:ReorderList></asp:content>

 

//Site Master file

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="VehicleSequencing.SiteMaster" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><!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><style type="text/css">
    /*Reorder List*/
.dragHandle {
      width:10px;
      height:15px;
      background-color:Blue;
      background-image:url(images/bg-menu-main.png);
      cursor:move;
      border:outset thin white;
}
.callbackStyle {
      border:thin blue inset;       
}
.callbackStyle table {
      background-color:#5377A9;     
      color:Black;
}
.reorderListDemo li {
      list-style:none;
      margin:2px;
      background-image:url(images/bg_nav.gif);
      background-repeat:repeat-x;
      color:#FFF;
}
.dragVisualContainer li {
    list-style:none;
      background-image:url(images/bg_nav.gif);
      background-repeat:repeat-x;
      color:#FFF;
}
.reorderListDemo li a {color:#FFF !important; font-weight:bold;}
.reorderCue {
      border:dashed thin black;
      width:100%;
      height:25px;
}
.itemArea {
      margin-left:15px;
      font-family:Arial, Verdana, sans-serif;
      font-size:1em;
      text-align:left;
}</style><!-- <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />--><asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder></head><body><form runat="server"><div class="page"><div class="header"><div class="title"><h1>
                    My ASP.NET Application</h1></div><div class="clear hideSkiplink"><asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"><Items><asp:MenuItem NavigateUrl="~/VehicleSeqMgmt.aspx" Text="Home"/></Items></asp:Menu></div></div><div class="main"><asp:ContentPlaceHolder ID="MainContent" runat="server"/></div><div class="clear"></div></div><div class="footer"></div></form></body></html>


 

 

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,

Disable paste option in HtmlExtended Editor

$
0
0

Is tehre is a way to disable paste option in Html editor (CNTL + V) in Design mode only. It can allow it in Html Mode.

 

Please advise me

Question on the slideshow extender

$
0
0

I need to set up the slide show based on a querystring parameter.  I thought I had this figured out, but I clearly don't understand something about how the webservice works. 

I have this in the .aspx page:

<asp:Button ID="btnPrev" runat="server" Text="Prev" />
    <asp:Button ID="btnPlay" runat="server" Text="Play" />
    <asp:Button ID="btnNext" runat="server" Text="Next" />
    <asp:Label ID="lblDesc" runat="server" />
    <cc1:SlideShowExtender ID="SlideShowExtender1" runat="server" BehaviorID="SSBehaviorID"
            TargetControlID="tstSlides"
            AutoPlay="true"
            ImageDescriptionLabelID="lblDesc"
            NextButtonID="btnNext"
            PreviousButtonID="btnPrev"
            PlayButtonID="btnPlay"
            PlayButtonText="Play"
            StopButtonText="Stop"
            Loop="true" >
        </cc1:SlideShowExtender>
    <asp:Image ID="tstSlides" runat="server" height="300px" Width="300px" />

And this in the code behind:

        Dim smate As String = "z-404932"

        'Create new array of valid file names from FileInfo
        Dim dir As New DirectoryInfo(HttpContext.Current.Request.ServerVariables("APPL_PHYSICAL_PATH").ToString() & "images\picts\")
        Dim files As FileInfo() = dir.GetFiles(smate & "*.jpg")
        Dim nLength As Integer = Len(smate)
        Dim newFiles As New ArrayList()
        For Each file As FileInfo In files
            If Mid(file.Name, nLength + 1, 1) = "-" Or Mid(file.Name, nLength + 1, 1) = "." Then
                newFiles.Add(file.Name)
            End If
        Next

        'now sort the arraylist
        newFiles.Sort()

        'now see if we have anything
        If newFiles.Count = 0 Then
            newFiles(0) = "no-photo.jpg"
        End If

        tstSlides.ImageUrl = "../images/picts/" & newFiles(0)
        SlideShowExtender1.SlideShowServiceMethod = "GetSlides()"

Also in the code behind is the webservice:

<System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethod()> _
      Public Shared Function GetSlides() As AjaxControlToolkit.Slide()
        Dim imgSlide(3) As AjaxControlToolkit.Slide

        imgSlide(0) = New AjaxControlToolkit.Slide("../images/picts/z-404932.jpg", "Autumn", "Autumn Leaves")
        imgSlide(1) = New AjaxControlToolkit.Slide("../images/picts/z-404932-2.jpg", "Creek", "Creek")
        imgSlide(2) = New AjaxControlToolkit.Slide("../images/picts/z-404932-3.jpg", "Landscape", "Landscape")
        imgSlide(3) = New AjaxControlToolkit.Slide("../images/picts/z-404932-4.jpg", "Dock", "Dock")

        Return (imgSlide)

smate is hardcoded for testing, it will be a querystring.  Now this all works fine.  I have no problem setting tstSlides.ImageUrl or SlideShowExtender1.SlideShowServiceMethod in the code behind.  But now I want to pass in newFiles.  But to simplify things for now, I could get by with passing in a simpler variale, smate.  So I add the parameters as so:

SlideShowExtender1.SlideShowServiceMethod = "GetSlides(smate)"

and

<System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethod()> _
      Public Shared Function GetSlides(ByVal smate As String) As AjaxControlToolkit.Slide()
        Dim imgSlide(3) As AjaxControlToolkit.Slide

        imgSlide(0) = New AjaxControlToolkit.Slide("../images/picts/z-404932.jpg", "Autumn", "Autumn Leaves")
        imgSlide(1) = New AjaxControlToolkit.Slide("../images/picts/z-404932-2.jpg", "Creek", "Creek")
        imgSlide(2) = New AjaxControlToolkit.Slide("../images/picts/z-404932-3.jpg", "Landscape", "Landscape")
        imgSlide(3) = New AjaxControlToolkit.Slide("../images/picts/z-404932-4.jpg", "Dock", "Dock")

        Return (imgSlide)

Note that I haven't changed anything in the webservice yet except for the new parameter.  The slideshow no longer works.  What am I not understanding?

How to get SelectedValue (not the SelectedText) in Ajax ComboBox

$
0
0

I am trying to get the SelectedValue from the Ajax Control Toolkit ComboBox. I noticed that the rendered HTML items for the combobox are bulletlists (<li>) items. A hiddenfield is rendered but this object holds the selectedindex not the selectedvalue. I need the selectedvalue to do some javascript programming.  The combobox is as follows:

<asp:ComboBox ID="ddlTest" Enabled="false"  runat="server">

        <asp:ListItem Text="Red" Value="1"></asp:ListItem>
        <asp:ListItem Text="White" Value="2"></asp:ListItem>
        <asp:ListItem Text="Black" Value="3"></asp:ListItem>
            </asp:ComboBox>

P.S. I have a databound combobox.

Here is the code snippet that I am using:

var dropDownList = document.getElementById(drlElementID);

var comboTextBox = dropDownList.control.get_textBoxControl();

var hiddenFieldID = dropDownList.control.get_hiddenFieldControl();

hiddenField.value gives the SelectedIndex and not the SelectedValue.

 

Any help on this is highly appreciated.


Does the UpdatePanel offset code behind logic?

$
0
0

I'm very new to ASP.Net 3.5 and C# 3.0. I'm trying to understand why my code below is broken. I'm using a datafilter tool that I discovered here (http://ammar.tawabini.com/2010/09/gridview-ajax-filter.html). The reason why I'm using this solution is because I needed to add a search feature to the "GridView"control I have on the page. Before I used this solution I was able to execute the export command that is embedded in the "GridView"with no problem.

My question is if a place a "GridView" with Command buttons inside an "UpdatePanel" does it off set the code behind for the Command button I have (in my case that would be the Export button).

If so how can I work around it so I can provide both functionality?


The code behind is here:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Drawing;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html.simpleparser;
using System.Configuration;


namespace DataFilterDemo
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataFilter1.DataSource = SqlDataSource1;
DataFilter1.DataColumns = GridView1.Columns;
DataFilter1.FilterSessionID = "Default";
DataFilter1.OnDataBound += new DataFilter.BindDataGridView(DataFilter1_OnDataBound);

}

void DataFilter1_OnDataBound()
{
try
{
DataFilter1.FilterSessionID = "Default";
DataFilter1.FilterDataSource();
GridView1.DataBind();
}
catch (Exception ex)
{
DataFilter1.Info = ex.Message;
}
}

public override void VerifyRenderingInServerForm(Control control)
{
/*Verifies that the control is rendered */
}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int eventid;
eventid = Convert.ToInt32(GridView1.SelectedDataKey.Value);

String strCon = ConfigurationManager.ConnectionStrings["CME_RFID"].ConnectionString;
DataTable dtExport = new DataTable();
String strSQL = "SELECT PersonID, Person_Last, Person_First, Person_Title, Life_Number, Event_Name, EventID, CME_Event_Track_ID FROM vAttendanceList WHERE EventID = " + eventid;

SqlConnection connect = new SqlConnection(strCon);
SqlCommand command = new SqlCommand(strSQL, connect);

SqlDataAdapter adExport = new SqlDataAdapter(command);

adExport.Fill(dtExport);


exportSpreadsheet(dtExport, "ExportReport");

}

public static void exportSpreadsheet(DataTable dtTable, String strName)
{
HttpContext context = HttpContext.Current;
context.Response.Clear();


foreach (DataColumn column in dtTable.Columns)
{
context.Response.Write(column.ColumnName + ",");
}
context.Response.Write(Environment.NewLine);
foreach (DataRow drRow in dtTable.Rows)
{
for (int i = 0; i < dtTable.Columns.Count; i++)
{
context.Response.Write(drRow[i].ToString().Replace(",", string.Empty) + ",");
}
context.Response.Write(Environment.NewLine);
}
context.Response.ContentType = "text/csv";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + strName + ".csv");
context.Response.End();
}
}

}



The markup is below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DataFilterDemo._Default" %><%@ Register src="DataFilter.ascx" tagname="DataFilter" tagprefix="uc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title></title></head><body><form id="form1" runat="server"><div></div></body> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><uc1:DataFilter ID="DataFilter1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate> <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="Black"
BorderStyle="Solid" BorderWidth="3px" CellPadding="4" DataKeyNames="EventID"
CellSpacing="2" ForeColor="Black" Width="984px" 
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"><RowStyle BackColor="White" /><Columns><asp:CommandField ButtonType="Button" CausesValidation="False" 
DeleteText="" EditText="Add Track ID" InsertText="" NewText="" 
SelectText="" ShowEditButton="True" UpdateText="Commit" /><asp:CommandField ButtonType="Button" 
DeleteText="" EditText="" InsertText="" NewText="" 
SelectText="Export" UpdateText="" InsertVisible="False" 
ShowCancelButton="False" ShowSelectButton="True" CancelText="" /> <asp:BoundField DataField="CME_Event_Track_ID" HeaderText="CME Track ID" SortExpression="CME_Event_Track_ID" /><asp:BoundField DataField="Event_Type" HeaderText="Event Type" SortExpression="Event_Type" Visible="False" /><asp:BoundField DataField="Event_Name" HeaderText="Event Name" SortExpression="Event_Name" /><asp:BoundField DataField="Event_Desc" HeaderText="Event Desc" SortExpression="Event_Desc" /><asp:BoundField DataField="Event_Date" HeaderText="Event Date" SortExpression="Event_Date" /> <asp:BoundField DataField="EventCount" HeaderText="Attendance Count" SortExpression="EventCount" /></Columns><FooterStyle BackColor="#CCCCCC" /><PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" /><EmptyDataTemplate>&nbsp;</EmptyDataTemplate><SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /><HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" /></asp:GridView><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CME_RFID %>" ProviderName="System.Data.SqlClient"
SelectCommand="SELECT CME_Events.EventID, CME_Events.Event_Name, CME_Events.Event_Desc, CME_Events.Dept_ID, CME_Events.Event_Date, CME_Events.Event_TimeStart, COUNT(CME_IDRegistration.recID) AS EventCount, CME_Events.CME_Event_Track_ID FROM CME_RFIDReader.CME_Events INNER JOIN CME_RFIDReader.CME_IDRegistration ON CME_RFIDReader.CME_Events.EventID = CME_RFIDReader.CME_IDRegistration.EventID GROUP BY CME_Events.EventID, CME_Events.Event_Name, CME_Events.Event_Desc, CME_Events.Dept_ID, CME_Events.Event_Date, CME_Events.Event_TimeStart, CME_Events.CME_Event_Track_ID ORDER BY Event_Date DESC"
UpdateCommand="UPDATE CME_RFIDReader.CME_Events SET CME_Event_Track_ID = @CME_Event_Track_ID WHERE EventID = @EventID"> </asp:SqlDataSource></ContentTemplate></asp:UpdatePanel></form></html>

Modalpopextener control and focus

$
0
0

I just added modalpopextender control for the save dialog box. The way it is supposed to work is that when the user let’s say Save the changes, the message box opens and the text of the message is read  by the screen reader. When they select the buttons in the message box, such as Yes, No or Cancel, the message box closes.

This should be the behavior across the entire application.

There will be a message box like the one  below. Try it with a keyboard. The focus is not lost. 

The user should not leave the message box until clicking buttons in the message box.  Even they cannot access any other stuff on the page unitl they they make a selection in the message box. 

Please assist me with this issue.

Thank you,

Chi Ming

The whole ajax extensions are not working urgent guys ??

$
0
0

The whole ajax extensions are not working in my whole project  e:g update panel , timers etc 

I am using vs 2008 3.5 version , some time it works some time not . mostly the problem is it works first update and not for second 

and the insert happens but not showing on the page i also binded the data again 

and i have included the ajax control toolkit dll also , 

if i add new page to my same project , then on that page all ajax extensions controls are working.

I am not  getting what is the problem 

Update Panel inside ModalPopup inside Tab Control

$
0
0

I wonder if I am just nesting too many AJAX containers. Can anybody see why the following wouldn't work. It tells me the PopupExtender is in a different UpdatePanel than the Panel it extends. They are clearly in the same one though. Any thoughts appreciated.

<asp:UpdatePanel ID="udpScheduleModal" runat="server"><ContentTemplate><asp:UpdateProgress ID="UpdateProgress2" AssociatedUpdatePanelID="udpScheduleModal" runat="server"><ProgressTemplate><div style="text-align: center; color: Red; font-size: 12px; font-weight: bold; position: relative;"><img src="images/ewestcor_loader.gif" alt="Loading" /></div></ProgressTemplate></asp:UpdateProgress><asp:ModalPopupExtender ID="mpeSchedule" runat="server"
                            PopupControlID="pnlModalPopup"
                            TargetControlID="btnHack"
                            BackgroundCssClass="modalBackground"
                            DropShadow="True"
                            OkControlID="btnHackOK"
                            CancelControlID="btnCancel" DynamicServicePath="" Enabled="true"></asp:ModalPopupExtender><asp:Panel ID="pnlModalPopup" CssClass="pnlBackGround" runat="server" Width="450px"><table width="100%"><tr><td colspan="2"><asp:Label ID="Label3" runat="server" Text="Quick Schedule Audit" Font-Bold="True" Font-Size="Large"></asp:Label></td></tr><tr><td colspan="2"><asp:Label ID="Label6" runat="server" Text="Auditor:" Width="125px" Font-Size="Medium"></asp:Label><asp:TextBox ID="txtAuditor" CssClass="txtbox" runat="server"></asp:TextBox></td></tr><tr><td colspan="2"><asp:Label ID="Label8" runat="server" Text="Auditor 2:" Width="125px" Font-Size="Medium"></asp:Label><asp:DropDownList ID="ddAuditors" runat="server"></asp:DropDownList></td></tr><tr><td colspan="2"><asp:Label ID="Label7" runat="server" Text="Scope:" Width="125px" Font-Size="Medium"></asp:Label><asp:TextBox ID="txtScope" CssClass="txtbox" runat="server"></asp:TextBox></td></tr><tr><td colspan="2"><asp:Label ID="Label4" runat="server" Text="Schedule Date:" Width="125px" Font-Size="Medium"></asp:Label><asp:TextBox ID="txtCalendar" CssClass="txtbox" runat="server"></asp:TextBox><asp:CalendarExtender ID="cext" TargetControlID="txtCalendar" runat="server" Enabled="True" /></td></tr><tr><td colspan="2"><asp:Label ID="Label5" runat="server" Text="Schedule Time:" Width="125px" Font-Size="Medium"></asp:Label><span id="time" style="font-size: medium">12:00 PM</span> </td></tr><tr><td colspan="2" width="100%" align="center"><asp:HiddenField ID="hfTime" runat="server" /><asp:TextBox ID="txtTimeSlider" runat="server"></asp:TextBox><asp:SliderExtender ID="SliderExtender1" runat="server"
                                            TargetControlID="txtTimeSlider"
                                            BehaviorID="slider"
                                            Minimum="0"
                                            Maximum="95"
                                            Steps="95" Enabled="True" /></td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2"><asp:CheckBox ID="ckbReminder" runat="server" Font-Size="Medium" Text="Send Audit E-Mail Reminder?" /></td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2" align="left"><asp:Button ID="btnOK" runat="server" Text="OK" UseSubmitBehavior="False" /><asp:Button ID="btnHackOK" runat="server" Text="OK" Style="display: none" /><asp:Button ID="btnCancel" runat="server" Text="Cancel" UseSubmitBehavior="False" /></td></tr></table></asp:Panel></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnSchedule" EventName="Click" /></Triggers></asp:UpdatePanel>



Javascript/JQuery after ajaxToolkit:CascadingDropDown populates

$
0
0

I have a page with an updatepanel that contains two ajaxToolkit:CascadingDropDown controls.
I am trying to populate them after the page loads using javascript and/or JQuery. However, with all of the methods I've tried the javascript runs before cascadingdropdown controls have rendered. It finds the initial dropdownlist controls just fine, but the cascadingdropdown controls return null.
I know the javascript function I'm calling is good, because it works if I make a button on the page call my function from there. So, it seems like the function is firing too early.
I've tried to fire it using window.load, document.ready, by registering a client startup script in my code behind, and by just calling the function in script tags located at the bottom of my aspx page. I've also tried adding a two second delay at the start of the function by waiting for the clock to reach now plus two seconds.


To summarize:
My function works, but is just not being called at the correct time. Where and when do I need to call it for the page to truly be finished loading all my controls?
Thanks,
JTok

Viewing all 5678 articles
Browse latest View live


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