Tag Archives: BulletedList

[RESOLVED]Problem with BulletedList and AJAX Toolkit

The following code always comes out with the error:

"The server tag ‘asp:BulletedList’ is is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix". 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebRole1.WebForm2" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<!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">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div>
        <asp:BulletedList ID="BulletedList1" runat="server" />
    </div>
    

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

Any suggestions?

Also, I’m using ASP 4.0, and the latest release of the AJAX toolkit…

The same problem happens in other versions of ASP.NET as well. The reason why you are getting the warning is that you have given the same "TagPrefix", asp, to AJAX toolkit controls. The "asp" TagPrefix is used for ASP.NET controls by default and I think
"BulletedList" is having conflict with the "BulletedListItem" control of AJAX toolkit control. Just give a different TagPrefix to the AJAX controls and that will solve your problem. The following line in your code needs to be modified.

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
 TagPrefix="asp" %>
//Modify the above to something like this.
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="ajx" %>

After you have changed the above TagPrefix change the “asp” prefixes before all the AJAX controls to “ajx” or whatever you have given in the TagPrefix property. 

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
    </asp:ToolkitScriptManager>  
//Change the above to something like this.
<ajx:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
    </ajx:ToolkitScriptManager>  

Hope this helps.

It worked, thanx a lot

 Thanks a lot – its work fine

correctly said..thnx a lot ..grt answer..it works…infact…

i was also suffering from the same problem ..then i used this suggestion…

[RESOLVED]FileUpload Inside a Repeater Can't Find File

My code is like this :

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource4" OnItemCommand="Repeater1_ItemCommand">
        <HeaderTemplate>
            <table ID="Table1">
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <asp:BulletedList ID="BulletedList1" runat="server" DataSourceID="SqlDataSource6" DataTextField="WPName" DataValueField="WPName"></asp:BulletedList>
                    <asp:Button ID="Button2" runat="server" Text="Add KKP" CommandName="AddKKP"/>
                    <asp:Panel ID="Panel1" runat="server" Visible="false">
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                        <asp:Button ID="Button3" runat="server" Text="Upload" CommandName="UploadKKP" />
                        <asp:Label ID="StatusLabel" runat="server" Text="Label"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>

and CodeBehind :

protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "AddKKP")
            {                      
                Panel myPanel = (Panel)e.Item.FindControl("Panel1");
                myPanel.Visible = true;                
            }

            if (e.CommandName == "UploadKKP")
            {
                Label myStatusLabel = (Label)e.Item.FindControl("StatusLabel");
                FileUpload myFileUpload = (FileUpload)e.Item.FindControl("FileUpload1");
                if (myFileUpload.HasFile)
                {
                    try
                    {
                        string filename = Path.GetFileName(myFileUpload.FileName);
                        myFileUpload.SaveAs(Server.MapPath("~/") + filename);
                        myStatusLabel.Text = "Upload Success";
                    }
                    catch (Exception ex)
                    {
                        
                        myStatusLabel.Text = "Upload Fail" + ex.Message;
                    }
                }
                else
                {
                    
                    myStatusLabel.Text = "myFileUpload Has No File";
                }
            }      
        }        

The problem is, it always throw myStatusLabel.Text = "myFileUpload Has No File";

how can i fix it ?

Thanks for your help.

Best Regards,

Use ajax file upload instead

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

Fileupload control not work in update panel

I’m trying to use AJAXControlToolkit, but it get an error :

‘MsAjaxBundle’ is not a valid script name.  The name must end in ‘.js’.

how can i fix it ?

thanks.

Refer below thread,

http://forums.asp.net/t/1864395.aspx/1

Hope this will helps..!!

[RESOLVED]AjaxFileUpload Inside A Repeater

My .aspx page is like this :

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
     <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource4" OnItemCommand="Repeater1_ItemCommand">
        <HeaderTemplate>
            <table ID="Table1">
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <asp:BulletedList ID="BulletedList1" runat="server" DataSourceID="SqlDataSource6" DataTextField="WPName" DataValueField="WPName"></asp:BulletedList>
                    <asp:Button ID="Button2" runat="server" Text="Add KKP" CommandName="AddKKP"/>
                    <asp:Panel ID="Panel1" runat="server" Visible="false">
                        <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server"></ajaxToolkit:AjaxFileUpload>
                    </asp:Panel>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
            </ContentTemplate>
    </asp:UpdatePanel>

how i declare codeBehind for AjaxFileUpload inside a repeater ? should i use FindControl ? how to throw CommandName from AjaxfileUpload upload button ?

my codeBehind :

protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
                       
            if (e.CommandName == "AddKKP")
            {
                Panel myPanel = (Panel)e.Item.FindControl("Panel1");
                myPanel.Visible = true;
            }
	}

Any sugestions ?

Thanks for your help.

Best Regards.

Hi,

Please refer to the example at:

http://forums.asp.net/p/1603720/4091630.aspx#4091630 

hi,

you can refer to blew code to get AjaxFileUpload.you can try it and test it.

private void getControl()
    {
        foreach (RepeaterItem item in Repeater1.Items)
        {
            Panel pnl = item.FindControl("Panel1") as Panel;
            AjaxControlToolkit.AjaxFileUpload af = (AjaxControlToolkit.AjaxFileUpload)pnl.FindControl("AjaxFileUpload1");
        
        }
   }

Hope this helps!

 

[RESOLVED]How to bind to ajax editor or?

Hi

I’ve got small project where on the aspx page is placed a CKeditor with some bindings. The CKeditor doesn’t work properly so I want to change it to ajaxtoolkit editor. But in the first line of the script for the CKeditor is CKEDITOR.replace("Ideforum1$dvemne$txtbeskrivelse"…
How do I bind this to the ajax editor?

The code behind is vb:

ProtectedSub btnOpretEmne_Click(sender As Object, e As System.EventArgs)Handles btnOpretEmne.Click, btnOpret2.Click

       panelOpretEmne.Visible =True

        panelEmneliste.Visible =False

        btnOpretEmne.Visible =False

       CType(dvEmner.FindControl("txtTitel"),TextBox).Text = ""

       CType(dvEmner.FindControl("txtBeskrivelse"), HtmlControls.HtmlTextArea).InnerHtml =""

   End Sub

 

the code on the aspx page:

<textareaid="txtBeskrivelse"runat="server" rows="3" cols="15"></textarea>

              

                    <cc1:EditorID="Editor1" runat="server" />

                   <%–<script type="text/javascript">

                       CKEDITOR.replace("Ideforum1$dvEmner$txtBeskrivelse", {

                            toolbar_Basic:

                  [

     ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],

    ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv'],

    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],

    ['Smiley']

                   ],

                            toolbar: ‘Basic’,

                            entities: false,

                            entities_latin: false,

                            entities_greek: false,

                            language: ‘dk’

                        });

                    </script>–%>

thx

Hi,

You can use the ajax control toolkit html editor with follow code:

<ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1"
            TargetControlID="TextBox1" DisplaySourceTab="true"
            runat="server"/>
            <Toolbar>
                <ajaxToolkit:Undo />
                <ajaxToolkit:Redo />
                <ajaxToolkit:Bold />
                <ajaxToolkit:Italic />
                <ajaxToolkit:Underline />
                <ajaxToolkit:StrikeThrough />
                <ajaxToolkit:Subscript />
                <ajaxToolkit:Superscript />
                <ajaxToolkit:JustifyLeft />
                <ajaxToolkit:JustifyCenter />
                <ajaxToolkit:JustifyRight />
                <ajaxToolkit:JustifyFull />
                <ajaxToolkit:InsertOrderedList />
                <ajaxToolkit:InsertUnorderedList />
                <ajaxToolkit:CreateLink />
                <ajaxToolkit:UnLink />
                <ajaxToolkit:RemoveFormat />
                <ajaxToolkit:SelectAll />
                <ajaxToolkit:UnSelect />
                <ajaxToolkit:Delete />
                <ajaxToolkit:Cut />
                <ajaxToolkit:Copy />
                <ajaxToolkit:Paste />
                <ajaxToolkit:BackgroundColorSelector />
                <ajaxToolkit:ForeColorSelector />
                <ajaxToolkit:FontNameSelector />
                <ajaxToolkit:FontSizeSelector />
                <ajaxToolkit:Indent />
                <ajaxToolkit:Outdent />
                <ajaxToolkit:InsertHorizontalRule />
                <ajaxToolkit:HorizontalSeparator />
                <ajaxToolkit:InsertImage />
            </Toolbar>
        </ajaxToolkit:HtmlEditorExtender>

More details, please refer to:

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx and
http://www.asp.net/ajaxlibrary/act_HTMLEditor.ashx .

[RESOLVED]CK editor is not working for asp.net pages

Resource interpreted as Script but transferred with MIME type text/html: "http://www.haquin.agora-me.com/ACMS/Scripts/Htmleditorjs/ckeditor/ckeditor.js". EditPageTextNew.aspx:54
Uncaught SyntaxError: Unexpected token < /ACMS/Scripts/Htmleditorjs/ckeditor/ckeditor.js:1
Resource interpreted as Script but transferred with MIME type text/html: "http://www.haquin.agora-me.com/ACMS/Scripts/Htmleditorjs/ckeditor/adapters/jquery.js". EditPageTextNew.aspx:54
Uncaught SyntaxError: Unexpected token < /ACMS/Scripts/Htmleditorjs/ckeditor/adapters/jquery.js:1
GET http://www.harlequin.agora-me.com/ckeditor/ckeditor.js?t=B8DJ5M3 404 (Not Found) EditPageTextNew.aspx:57
Uncaught TypeError: Object [object Object] has no method 'ckeditor'

CK editor is not working for asp.net pages

Its working on local server but as i uploaded on server its showing error:

<script type="text/javascript">

$(function () {
var config = {
toolbar:
[
['Styles', 'Format', 'Font', 'FontSize'], ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', 'Link', 'Unlink', 'Subscript', 'Superscript'],
['UIColor'], ['TextColor'], ['Undo', 'Redo']
]

};

config.height = "150px";
$(‘.jquery_ckeditor’).ckeditor(config);
});

</script>

plz suggets

</script>

Smadhu

Resource interpreted as Script but transferred with MIME type text/html:

Hi Smadhu,

As the error said,Your HTTP Response Header MIME didnot mathch the file type.

When broswer request the js or css file,it received the Content-Type of HTTP Response Header is  text/html type,it can not parse the css file or js file,So it throw error.

If your HTML file include the <!DOCTYPE html>,The brower is the standards and may be have the comptibility problem in different broswers.

So you can remove <!DOCTYPE html> from your html code.And try it again.

Hope this helps!

OK, so you’re hosting your ASP.NET website on DotNetPanel and you’re getting following error: “DotNetPanel IIS Modules Error AuthName directive not found” when trying to display CKEditor instance. Resolution to this problem is fairly simple.
Connect to your web site with FTP or DotNetPanel File Manager, go to CKEditor folder and delete any.htaccess files found. After that, reload your page and CKEditor should work as expected. 

http://ocvirek.com/?p=136

[RESOLVED]Validate image file type

If the following validates the file size; what would be the line for file type?

if (Request.Files.Count < 250) { }

engcanada

if (Request.Files.Count
< 250)
{ }

That just ensures that less than 250 files were uploaded. ContentLength gives you the size in bytes. You can get the extension from Path.GetExtension(filename):

var allowedExtensions = new[]{".png", ".gif", ".jpg" };
var uploadedFile = Request.Files[0];
var fileName = Path.GetFileName(uploadedFile.FileName);
var extension = Path.GetExtension(fileName);
if(allowedExtensions.Contains(extension)){
    //file meets the allowed type
}

Thanks for pointing that out. Then, how does ContentLength is being used?

I dont’ think it is referred to as follows

if (Request.Files.ContentLength  < 512000) { }

Hope this example will help you

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void Button1_Click(object sender, EventArgs e)
    {
        // Clear the BulletedList.
        BulletedList1.Items.Clear();

        // Check to see if at least one file was specified.
        if (FileUpload1.HasFile | FileUpload2.HasFile)
        {
            Label1.Text = "The file collection consists of:";

            // Get the HttpFileCollection.
            HttpFileCollection hfc = Request.Files;
            foreach (String h in hfc.AllKeys)
            {
                // Add an item to the BulletedList if a file
                // was specified for the corresponding control.
                if (hfc[h].ContentLength > 0) // You can check content type by hfc[h].ContentType
                    BulletedList1.Items.Add(Server.HtmlEncode(hfc[h].FileName));
            }

        }
        else
        {
            Label1.Text = "You did not specify any files to upload or " +
                "the file(s) could not be found.";
        }

    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>HttpFileCollection Example</title>
</head>
<body>
    <form id="form1"
          runat="server">
    <div>
        <asp:FileUpload ID="FileUpload1"
                        runat="server" />
        <br />
        <asp:FileUpload ID="FileUpload2"
                        runat="server" />
        <br />
        <asp:Button ID="Button1"
                    runat="server"
                    OnClick="Button1_Click"
                    Text="Upload" />
        <br />
        <asp:Label ID="Label1"
                   runat="server"/>
        <br />
        <asp:BulletedList ID="BulletedList1"
                          runat="server">
        </asp:BulletedList>
        </div>
    </form>
</body>
</html>

Thanks but I am using Razor syntax.

Request.Files is a collection. You reference individual files by their zero-based index in that collection, so the first file is Request.Files[0]. 

var file = Request.Files[0];
var contentLength = file.ContentLength;

I can’t get it to work. It only returns an error if I specify if (Request.Files[0].ContentLength < 0) anything greater that ZERO uploads the file

try{
                          if (Request.Files[0].ContentLength < 0) {
                            newFileName = vbliduser +  vblextension;
                            photo.Resize(width: 300, height: 300, preserveAspectRatio: true, preventEnlarge: true);
                            photo.Save(@"~images" + newFileName);
                           }else{
                               vblerror ="1";
                           }
                        }
                        catch(HttpException ex){
                           /***/
                        }

The file will always be uploaded. The only way you can prevent that is if you use some kind of Flash or Silverlight based client-side upload which can getthe file’s length in the browser. You can set a maxRequestLength value in web.config (by default it’s
4MB) to cause an HttpException at a lower value than the default, but that still relies on the file being fully uploaded. 

[RESOLVED]Possible to highlight specific ListItem?

I have a page with a BulletedList which serves as a menu.  Each item shows text and has a url behind it.  BulletedList is loaded from database.

Is it possible to distinguish one or more ListItems by changing certain display attributes such as font, color, etc.?  ListItem does not have access to these display attributes directly.

I know it is possible to do this in other ways, but before I make this change, I wanted to see if it is possible.

 

Ideas most appreciated.

Saavik

Is it possible to distinguish one or more ListItems by changing certain display attributes such as font, color, etc.?  ListItem does not have access to these display attributes directly.

LI is your selected ListItem.
LI.Attributes.Add("disabled","true");

Hi You can do this by jquery 

Sample code is below

Script

<script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#divMenu li a").addClass("clsDefault"); $("#divMenu li a").click(function () { $("#divMenu li a").removeClass("clsActive"); $(this).addClass("clsActive"); }); }) </script>
Style

<style type="text/css">
    .clsDefault
    {
        color:Green;
    }
    .clsActive
    {
        color:Red;
    }
</style>

HTML Content

<div id="divMenu">
        <ul>
            <li><a href="#">Menu1</a></li>
            <li><a href="#">Menu2</a></li>
            <li><a href="#">Menu3</a></li>
            <li><a href="#">Menu4</a></li>
        </ul>
    </div>



hi Saavik,

According to your description, you need to add the code in backends :
‘Attributes.Add("style", "font-weight:bold;");’
or coustom the style  ‘#DropDownList1 option{
            background-color:yellow;  }’

i would suggest you check out the demo below:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style >
        #DropDownList1 option{
            background-color:yellow;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
     <p><asp:dropdownlist
          id="DropDownList1"
          runat="server"
          autopostback="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
           <asp:listitem selected="True">未选择</asp:listitem>
          <asp:listitem >Sales Representative</asp:listitem>
          <asp:listitem>Sales Manager</asp:listitem>
          <asp:listitem>Vice President, Sales</asp:listitem>
      </asp:dropdownlist></p>
</form>
</body>
</html>
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList1.Items.FindByValue("Sales Manager").Attributes.Add("style", "font-weight:bold;");//add style
    }

Hope it helps you.

Happy Chen,

 

Thank you for your reply.  While your code works well, it was not my intent to change the background of ALL list items, only the one that is being hovered over with the mouse.

After some research, including this thread, I gave up on the possibility of this being done; at least not without a lot of work, and that would not be good ROI.

Ideas are most appreciated.

 

If so, i would suggest you try the way below:

 <style >
        #DropDownList1 option:hover{
            background-color:yellow;
        }
    </style>

Hope it helps you.

Thank you for this suggestion.  I have tried it before, and now again – it does not work for me.

Ideas most appreciated.

please see live demo:

http://jsbin.com/sotiniri/1/edit

it is working for me, if it is not helpful for you, you’d better provide a simple demo.

Thank you for providing the live demo.  I looked at it, and it did not work for me - sorry.

I moved the mouse over the Dropdownlist items and saw one item’s background RED, and the ones being hovered over as light blue (the default for Win7-at least my installation). 

It is this blue I was hoping to change.

I am using IE9, Win7-64.

Thank you for your time.  Ideas most appreciated.

Yes, I have a try  with :hover and it does not work in IE8 and IE9. if you want to use :hover, you have to update the version to IE10+.

DropDownList s control is server control, which ListItem is not appliwd to the css style.

i would suggest you try use Custom Drop-Down List Styling, check out the link:
http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/

Thank you for your suggestion.  The custom drop-down seem quite interesting.  For now, this seems too much work for my needs, but I will examine it and consider for future sites.

 

Thank you for your suggestion.  The custom drop-down seem quite interesting.  For now, this seems too much work for my needs, 
but I will examine it and consider for future sites.

i‘m glad that it rosolved your issue,if using traditional tag and custom drop-down css style , you don’t
need to consider compatibility.

If you think one reply solves your problem, please mark it as An Answer. If you need more assistance ,please let me know.

Best regard!

[RESOLVED]update panel – how to prevent parent panel from updating

I have a parent UpdatePanel (panelParent) and within it, I have another UpdatePanel (panelChild).

I have parentChild set to:
 - ChildrenAsTriggers = false
 - UpdateMode = conditional

When I click on my linkbuttons within the panelChild panel, the entire panelParent refreshes.

How can I prevent the parent control from updating?

Thanks,
John

Also, you will need to set the UpdateMode="Conditional" for the outer UpdatePanel ( parent ).

See  "Using Nested UpdatePanel Controls " section in this link for an example.

john_es

I have parentChild set to:
 - ChildrenAsTriggers = false
 - UpdateMode = conditional

What about the parent panel? it must be like the child panel:

- ChildrenAsTriggers = false
 - UpdateMode = conditional

alaa9jo

it must be like the child panel:

- ChildrenAsTriggers = false

In this case, There is no need to set ChildrenAsTriggers proeprty to false.

Reference to MSDN[Taken from
this
link]

Child controls of nested UpdatePanel controls will not cause an update of the
parent UpdatePanel control’s content unless you call the
Update method explicitly or you define the child controls as triggers.

Thanks guys…

I’ve set both the parent and the child update panel to:

- ChildrenAsTriggers = false
 - UpdateMode = conditional

yet, each time I click on the linkbutton in the PagingBulletedList, it postsback and refreshes the parent updatepanel.

What else could I be missing?

for your child panel,change ChildrenAsTriggers to true!

Hey,

Sorry for the hijack – thought it better than starting again.

I have exactly the same problem. I want to stop the child panel from updating the parent panel.

My structure is like this:

ParentUpdatePanel > Repeater > ChildUpdatePanel > Repeater.

The child update panel is a list of attachments for a given item. When somebody refreshes the list of attachments, I don’t want the parent panel to refresh as well.

I have both panels set to Conditional and ChildrenAsTriggers set to false for the parent, and true for the child.

 

Thanks

EDIT: It seems that pressing the Enter key if the updatepanel has focus is causing the postback. Can I disable this if the updatepanel has focus. I have a textbox outside the updatepanel that should still update the updatepanel when pressing the enter key.

EDIT2: Actually, it’s not just Enter key – I put a button inside the child panel and it is updating the parent panel.

[RESOLVED]Using a combobox to update the content in another combobox.

I have been cracking my head for the last 4 days trying to get the comboboxes to work.  I’m trying to convert an existing client app into web and one of the feature of the client app is having a combobox to allow them to enter data that are not in the system. 
But if they select or entered an existing data then the system would populate another combobox with a set of relevent data pertaining to the initial data.  As aspx does not have combobox, has to use jquery.  Having lots of problem trying to do the postback. 
Managed to do the postback but doesn’t seems to be able to get the info populated to the other combobox.  Can some help? Please!

Hi,

Can you give a screenshot and how you wish your comboboxes to get work… It could make us all to understand your issue and help 

                    <asp:Panel runat="server" ID="pnlGeneral" CssClass="poContent" Visible="true" >
                        <div class="poTab">
                            <asp:BulletedList ID="ulGeneral" runat="server" BulletStyle="NotSet" DisplayMode="LinkButton" CssClass="ulGeneral" OnClick="ul_Click">
                                <asp:ListItem Text="General"></asp:ListItem>
                                <asp:ListItem Text="Billing"></asp:ListItem>
                                <asp:ListItem Text="Adjustment"></asp:ListItem>
                                <asp:ListItem Text="Cancellation"></asp:ListItem>
                            </asp:BulletedList>
                        </div>
                        <div class="poContentDetails">
                            <fieldset class="poGenFieldset">
                                <p>
                                    <asp:Label ID="lblClientPO" runat="server" Width="140" AssociatedControlID="txtClientPO">&nbsp;Client PO No.</asp:Label>
                                    <asp:RequiredFieldValidator ID="reqAE" runat="server" ControlToValidate="ddlAE" 
                                        CssClass="failureAsterix" ErrorMessage="Account Executive is required." ToolTip="Account Executive is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblAE" runat="server" Width="230" AssociatedControlID="ddlAE">Account Executive</asp:Label>
                                    <asp:TextBox ID="txtClientPO" runat="server" CssClass="textEntryShort" Width="135px" ></asp:TextBox>
                                    <span class="spnAE">
                                        <asp:DropDownList ID="ddlAE" runat="server" Width="227" DataSourceID="dsAE" DataTextField="Name"
                                            DataValueField="Name" ValidationGroup="POValidationGroup" MustSelect="true"></asp:DropDownList>
                                    </span>
                                 </p>
                                <p style="width:610px;">
                                    <asp:RequiredFieldValidator ID="reqClient" runat="server" ControlToValidate="ddlClient" 
                                        CssClass="failureAsterix" ErrorMessage="Client is required." ToolTip="Client is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblClient" runat="server" AssociatedControlID="ddlClient">Client</asp:Label><br />
                                    <span class="spnClient">
                                        <asp:DropDownList ID="ddlClient" runat="server" Width="586px" DataSourceID="dsClient" DataTextField="Name" 
                                            DataValueField="Name" ValidationGroup="POValidationGroup" MustSelect="true"></asp:DropDownList>
                                    </span>
                                </p>
                                <p>
                                    <asp:RequiredFieldValidator ID="reqContact" runat="server" ControlToValidate="txtContact" 
                                        CssClass="failureAsterix" ErrorMessage="Contact Person is required." ToolTip="Contact Person is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblContact" runat="server" AssociatedControlID="txtContact" Width="294px">Contact Person</asp:Label>
                                    <asp:RequiredFieldValidator ID="reqTel" runat="server" ControlToValidate="txtTel" 
                                        CssClass="failureAsterix" ErrorMessage="Telephone No. is required." ToolTip="Telephone No. is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblTel" runat="server" AssociatedControlID="txtTel" Width="148px">Telephone No.</asp:Label>
                                    <asp:RequiredFieldValidator ID="reqFax" runat="server" ControlToValidate="txtFax" 
                                        CssClass="failureAsterix" ErrorMessage="Fax No. is required." ToolTip="Fax No. is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblFax" runat="server" AssociatedControlID="txtFax" Width="148px">Fax No.</asp:Label>
                                    <asp:TextBox ID="txtContact" runat="server" CssClass="textEntry" Width="294px"></asp:TextBox>
                                    <asp:TextBox ID="txtTel" runat="server" CssClass="textEntryShort" Width="144px"></asp:TextBox>
                                    <asp:TextBox ID="txtFax" runat="server" CssClass="textEntryShort" Width="150px"></asp:TextBox>
                                </p>
                                <p>
                                    <asp:RequiredFieldValidator ID="reqProduct" runat="server" ControlToValidate="txtProduct" 
                                        CssClass="failureAsterix" ErrorMessage="Product is required." ToolTip="Product is required."
                                        ValidationGroup="POValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="lblProduct" runat="server" AssociatedControlID="txtProduct">Product</asp:Label>
                                    <asp:TextBox ID="txtProduct" runat="server" CssClass="textEntryLong" Width="606px"></asp:TextBox>
                                </p>
                            </fieldset>
                            <fieldset class="poGenFieldset">
                                <div style="float:left; width:570px;">
                                    <div style="float:left;margin: 2px 12px 5px 10px;">
                                        <div style="display:inline-block; width:170px;">
                                            <asp:RequiredFieldValidator ID="reqLang" runat="server" ControlToValidate="ddlLanguage" 
                                                CssClass="failureAsterix" ErrorMessage="Language is required." InitialValue="" 
                                                ToolTip="Language is required." ValidationGroup="JOValidationGroup">*</asp:RequiredFieldValidator>
                                            <asp:Label ID="lblLang" runat="server" AssociatedControlID="ddlLanguage" Width="128px">Language</asp:Label><br />
                                            <asp:DropDownList ID="ddlLanguage" runat="server" Width="130px" DataSourceID="dsLang" AutoPostBack="true"
                                                DataTextField="Lang" DataValueField="Lang" />
                                        </div>
                                        <div style="display:inline-block; width:120px">
                                            <asp:RequiredFieldValidator ID="reqDuration" runat="server" ControlToValidate="ddlDuration" 
                                                CssClass="failureAsterix" ErrorMessage="Duration is required." InitialValue="" 
                                                ToolTip="Duration is required." ValidationGroup="JOValidationGroup">*</asp:RequiredFieldValidator>
                                            <asp:Label ID="lblDuration" runat="server" AssociatedControlID="ddlDuration" Width="100px">Duration</asp:Label>
                                            <asp:DropDownList ID="ddlDuration" runat="server" Width="100px" DataSourceID="dsDuration" 
                                                DataTextField="Duration" DataValueField="Duration" AutoPostBack="true" >
                                            </asp:DropDownList>
                                        </div>
                                        <div style="display:inline-block; width:120px;">
                                            <asp:Label ID="lblRate" runat="server" AssociatedControlID="txtRate" Width="100px">&nbsp;Rate $</asp:Label>
                                            <asp:TextBox ID="txtRate" runat="server" CssClass="textEntryShort" Width="100px"></asp:TextBox>
                                        </div>
                                        <div style="display:inline-block; width:120px;">
                                            <asp:Label ID="lblQty" runat="server" AssociatedControlID="txtQty">Quantity</asp:Label>
                                            <asp:TextBox ID="txtQty" runat="server" CssClass="textEntryShort" Width="100px" Text="1"></asp:TextBox>
                                        </div>
                                    </div>
                                    <p>
                                        <asp:RequiredFieldValidator ID="reqJobDesc" runat="server" ControlToValidate="ddlJobDesc" 
                                            CssClass="failureAsterix" ErrorMessage="Job Description is required." ToolTip="Job Description is required."
                                            ValidationGroup="JOValidationGroup" InitialValue="">*</asp:RequiredFieldValidator>
                                        <asp:Label ID="lblJobDesc" runat="server" AssociatedControlID="ddljobDesc">Job Description</asp:Label>
                                        <asp:DropDownList ID="ddlJobDesc" runat="server" Width="540px"></asp:DropDownList>
                                    </p>
                                </div>
                                <div style="float:right;width:72px;margin: 10px 0px;">
                                    <asp:Button ID="btnJOAdd" runat="server" Text="Add" Width="60px" />
                                    <asp:Button ID="btnJOEdit" runat="server" Text="Edit" Width="60px" />
                                    <asp:Button ID="btnJODel" runat="server" Text="Delete" Width="60px" />
                                </div>
                                </span>
                            </fieldset>
                        </div>
                    </asp:Panel>

I can’t paste an image so here’s part of the code.  Hope it helps.  There are actually a number of dropdownlist, all of which has been defined using the combobox.  Below is the javascript that convert it into combobox and the postback.

        $(function () {
            $("#<%=ddlAE.ClientID%>").combobox();
            $("#<%=ddlClient.ClientID%>").combobox();
            $("#<%=ddlLanguage.ClientID%>").combobox();
            $("#<%=ddlDuration.ClientID%>").combobox();
            $("#<%=ddlJobDesc.ClientID%>").combobox();
            $('#<%=ddlLanguage.ClientID.Replace("ddl","txt")%>').change( function() {
                __doPostBack("<%=ddlJobDesc.ClientID%>", "UpdateJobDesc");
                return false;
            });
            $('#<%=ddlDuration.ClientID.Replace("ddl", "txt")%>').change(function () {
                __doPostBack("<%=ddlJobDesc.ClientID%>", "UpdateJobDesc");
                return false;
            });
        });

The problem combobox is the Language, Duration and Job Description.  The Job Description info can be obtained from the database based on the selection of the Language and Duration.  I’ve also added the input trigger into the combobox jquery script for the
input.autocomplete change and select.

Hi Felix,

Are you looking to do something like this:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>fill the second drop down</title>
    <script type="text/javascript">
        function fillTheOtherDropDown(firstDropDownID)
        {
            var contentForDropDown="<select id='dropDown'>";
            var length=document.getElementById(firstDropDownID).length;
            var arrayForSecondDD=["test","has","been","completed"];
            for(var i=0;i<length;++i)
            {
                contentForDropDown += "<option value=" + arrayForSecondDD[i] + ">" + arrayForSecondDD[i] + "</option>";
            }
            contentForDropDown+="</select>";
            document.getElementById('dropDown').outerHTML=contentForDropDown;
        }


    </script>
</head>
<body>
    <form id="form1" runat="server">
     <select id="firstDropDown" onchange="fillTheOtherDropDown('firstDropDown')">
        <option value="this">This</option>
        <option value="is">is</option>
        <option value="A">A</option>
        <option value="Test">Test</option>
    </select>
    <select id="dropDown">
    </select>
    
    </form>
</body>
</html>

please try, hope it helps.

hello

you can create javascript function to populate data from database and call this function at the end of first function

Thanks Shivi but I managed to customized my combobox jquery to perform the necessary ajax postback.  But I’ve just found out that when I did a final postback, the entire combobox got reverted back to normal dropdownlist.  Search the entire net to find a
solution.  Advice give was to add pageload function but have no idea which code I should include in the pageload function.  Can someone help?

Hi FelixZcat,

For we didn’t know how did you to customize your combobox to perform the necessary ajax post.

I suggests that you create a simple project  with the only code which does not work and share it.

Best Regards,

Kevin Shen.

Hi Kevin,

Thanks for the response.  I’ve managed to resolved the issue by using the same methology as I had used for the calendar, ie by wrapping the codes as per below

        function pageLoad() {
            $(document).ready($(function () {
                Code goes here
            })
        )}

Regards,

Felix
 

[RESOLVED]I am not able to get the drap and drop functionality in IE11

Is drag and drop functionality of Webparts supported in IE 11?

<asp:WebPartManager ID="WebPartManager1" runat="server">
            <StaticConnections>
                <asp:WebPartConnection ID="connection1"
                    ConsumerConnectionPointID="ZipCodeConsumer"
                    ConsumerID="zipConsumer"
                    ProviderConnectionPointID="ZipCodeProvider"
                    ProviderID="zipProvider" />
            </StaticConnections>
        </asp:WebPartManager>
        <div class="div1">
            <asp:WebPartZone ID="WebPartZone1" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <uc1:UserCtrlForProperty runat="server" ID="UserCtrlForProperty"/>
                    <asp:BulletedList ID="BulletedList1" runat="server" Title="Select Movie/Book">
                        <asp:ListItem Text="Books" Value="B"></asp:ListItem>
                        <asp:ListItem Text="Movies" Value="M"></asp:ListItem>
                    </asp:BulletedList>

                </ZoneTemplate>
            </asp:WebPartZone>
        </div>
        <div class="div2">
            <asp:WebPartZone ID="WebPartZone2" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <asp:Calendar ID="Calendar1" runat="server" Title="My Static Calendar"></asp:Calendar>
                </ZoneTemplate>
            </asp:WebPartZone>
        </div>

Hi,

For this situation, I have test the webparts in Internet Explorer 11, and it would not be able to support the drag and drop functionality. However, you could refer to the following links for more information:

http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html

http://www.codeproject.com/Articles/337551/A-Beginners-Tutorial-on-ASP-NET-Web-Parts

Regards