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

Fetch 3 XML outputs in Ado.net

$
0
0

Hi,

My SP output is 3 xml data sets (For which i m getting using XML Explicit)

which method i have to use to catch in ado.net?

(For single xml dataset i am using 

public  XmlDocument GetMenuXML()
            {
                System.Xml.XmlDocument doc = Db.ExecuteXMLReader("ABC_XML");
                return doc;
            }

which workes fine for me)

but with three how to deal ?


Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

$
0
0

Hi All,
 I am facing problem in Rad  Tab control.Actually master page is not getting updated.so i used update panel.After adding Update Panel i got this type of error which is dedefined below. while click on any module which is used telerik rad tab control,i am getting this below error in pop up window. So how to avoid this error.........???????????
  
Please help me to fix this issue.


Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element. 

              This is code--
 <body scroll="no">
    <form id="thisMainform" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

  <%--  Added UpdatePanel to refresh the page  for opening proper Help Docs--%>
    <asp:UpdatePanel ID ="Updatecontrols" runat="server" >
    <ContentTemplate>
    <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"
        bgcolor="#ffffff">
        <tbody>
            <tr>
                <td align="center" valign="middle" class="headerbg" height="14%">
                    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td align="left" valign="middle" class="logo" style="padding-left: 10px">
                                <img runat="server" src="~/images/Client_Logo.png" />
                            </td>
                            <td align="right" valign="top">
                                <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td align="right" valign="top">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td colspan="7" align="right" style="padding-right: 10px;" height="45">
                                                        <img runat="server" src="~/images/adaptive_logo.gif" width="246" height="37" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="75%" align="left" valign="top">
                                                        <asp:Label ID="lblUserName" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td width="24" align="left" valign="middle">
                                                        <img runat="server" src="~/images/Home_icon.gif" width="14" height="14" hspace="5" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                   <asp:LinkButton ID="lnkBtnHome" runat="server" Text="Home" PostBackUrl="~/AdaptivePortfolio/AdaptivePortfoliloMain.aspx"
                                                            CausesValidation="false" />
                                                    </td>
                                                    <td width="25" align="left" valign="top">
                                                        <img runat="server" src="~/images/Help_icon.gif" width="16" height="20" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                        <asp:LinkButton ID="lnkbtnHelp" runat="server" Text="Help" CausesValidation="false" />
                                                    </td>
 
                                                      <td width="25" align="left" valign="top">
                                                        <img id="ImgVLink" runat="server" src="~/images/video.png" width="16" height="20" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                  
                                                        <asp:LinkButton ID="lnkBtnVLink"  runat="server" Text="Video"  CausesValidation="false" /> 
                                                       <%--  OnClick="ShowVLink()"--%> 
                                                    </td>



                                                    <td width="25" align="left" valign="top">
                                                        <img id="imgLogout" runat="server" src="~/images/Loigout_icon.gif" width="18" height="20" />
                                                    </td>
                                                    <td width="133" align="left" valign="middle">
                                                        <asp:LinkButton ID="lnkbtnLogout" runat="server" OnClick="lnkbtnLogout_Click" Text="Logout"
                                                            CausesValidation="false" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td height="6" colspan="2" align="left" valign="top" bgcolor="#4DA5CF">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top" height="77%">
                    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <telerik:radtabstrip runat="server" id="RadTabMain" width="100%" skin="Office2007"
                                    selectedindex="0">
                                    <Tabs>
                                        <telerik:RadTab runat="server" Text="Adaptive Portfolio System" Value="portfolio"
                                            NavigateUrl="~/AdaptivePortfolio/AdaptivePortfoliloMain.aspx" />
                                        <telerik:RadTab runat="server" Text="Adaptive Management System" Value="Management"
                                            NavigateUrl="~/AdaptiveManagement/bin-release/AMSHome.aspx" />
                                    </Tabs>
                                </telerik:radtabstrip>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" height="100%">
                                <asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server">
                                </asp:ContentPlaceHolder>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
</tbody>
    </table>
   
   </ContentTemplate>
 </asp:UpdatePanel>

Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

$
0
0

Hi All,
 I am facing problem in Rad  Tab control.Actually master page is not getting updated.so i used update panel.After adding Update Panel i got this type of error which is dedefined below. while click on any module which is used telerik rad tab control,i am getting this below error in pop up window. So how to avoid this error.........???????????
  
Please help me to fix this issue.


Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element. 

              This is code--
 <body scroll="no">
    <form id="thisMainform" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

  <%--  Added UpdatePanel to refresh the page  for opening proper Help Docs--%>
    <asp:UpdatePanel ID ="Updatecontrols" runat="server" >
    <ContentTemplate>
    <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"
        bgcolor="#ffffff">
        <tbody>
            <tr>
                <td align="center" valign="middle" class="headerbg" height="14%">
                    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td align="left" valign="middle" class="logo" style="padding-left: 10px">
                                <img runat="server" src="~/images/Client_Logo.png" />
                            </td>
                            <td align="right" valign="top">
                                <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td align="right" valign="top">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td colspan="7" align="right" style="padding-right: 10px;" height="45">
                                                        <img runat="server" src="~/images/adaptive_logo.gif" width="246" height="37" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="75%" align="left" valign="top">
                                                        <asp:Label ID="lblUserName" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td width="24" align="left" valign="middle">
                                                        <img runat="server" src="~/images/Home_icon.gif" width="14" height="14" hspace="5" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                   <asp:LinkButton ID="lnkBtnHome" runat="server" Text="Home" PostBackUrl="~/AdaptivePortfolio/AdaptivePortfoliloMain.aspx"
                                                            CausesValidation="false" />
                                                    </td>
                                                    <td width="25" align="left" valign="top">
                                                        <img runat="server" src="~/images/Help_icon.gif" width="16" height="20" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                        <asp:LinkButton ID="lnkbtnHelp" runat="server" Text="Help" CausesValidation="false" />
                                                    </td>
 
                                                      <td width="25" align="left" valign="top">
                                                        <img id="ImgVLink" runat="server" src="~/images/video.png" width="16" height="20" />
                                                    </td>
                                                    <td width="70" align="left" valign="middle">
                                                  
                                                        <asp:LinkButton ID="lnkBtnVLink"  runat="server" Text="Video"  CausesValidation="false" /> 
                                                       <%--  OnClick="ShowVLink()"--%> 
                                                    </td>



                                                    <td width="25" align="left" valign="top">
                                                        <img id="imgLogout" runat="server" src="~/images/Loigout_icon.gif" width="18" height="20" />
                                                    </td>
                                                    <td width="133" align="left" valign="middle">
                                                        <asp:LinkButton ID="lnkbtnLogout" runat="server" OnClick="lnkbtnLogout_Click" Text="Logout"
                                                            CausesValidation="false" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td height="6" colspan="2" align="left" valign="top" bgcolor="#4DA5CF">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top" height="77%">
                    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <telerik:radtabstrip runat="server" id="RadTabMain" width="100%" skin="Office2007"
                                    selectedindex="0">
                                    <Tabs>
                                        <telerik:RadTab runat="server" Text="Adaptive Portfolio System" Value="portfolio"
                                            NavigateUrl="~/AdaptivePortfolio/AdaptivePortfoliloMain.aspx" />
                                        <telerik:RadTab runat="server" Text="Adaptive Management System" Value="Management"
                                            NavigateUrl="~/AdaptiveManagement/bin-release/AMSHome.aspx" />
                                    </Tabs>
                                </telerik:radtabstrip>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" height="100%">
                                <asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server">
                                </asp:ContentPlaceHolder>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
</tbody>
    </table>
   
   </ContentTemplate>
 </asp:UpdatePanel>

error

$
0
0

when i install dotnetfx3 in my PC the following error occured 

Vertical Tab Container Height

$
0
0

Hello,

I'm using the AJAX toolkit tab container control.  I have the tabs set to vertical. Both the tabs and tab content are generated dynamically.

This has created a problem, because if the first tab has tab content that is not tall enough, the entire tab container doesn't show up - I get an invalid parameter error in my ScriptResource.axd file near the line $get(a.get_id()+"_headerSpannerHeight").style.height=j;


Furthermore - checking the tabpanel or tabcontainer height from code gives a height value of 0 - it seems that the height isn't generated until the control renders?

I've gotten around this issue by checking my category count - but surely there must be a better way to accomplish this?

Code for workaround:

                                If r.Items.Count < arrCategories.Count - 1 Then
                                    tp.Height = (arrCategories.Count - 1) * 25
                                Else
                                    tp.Height = r.Items.Count * 25
                                End If

Thanks,

Mike

Actionlink.ajax() is not working in ie10

$
0
0

hi all,

Actionlink.ajax() is not working in ie10   but working perfectly fine in other browsers  , i even tried using  $.get() instead of Actionlink.ajax() but of no use

CascadingDropDownBox

$
0
0

Hi, I have created a webpage with two drop down boxes.

Continent: <asp:DropDownList ID="ddlContinent" runat="server" /><ajaxToolkit:CascadingDropDown ID="cddcontinent" runat="server" TargetControlID="ddlContinent"
    Category="Continent" ServicePath="Helper.asmx" ServiceMethod="GetContinents" /><br />

Country: <asp:DropDownList ID="ddlCountry" runat="server" /><ajaxToolkit:CascadingDropDown ID="ccdCountry" runat="server" TargetControlID="ddlCountry"
    ParentControlID="ddlContinent" Category="country"
    ServicePath="Helper.asmx" ServiceMethod="GetCountries" /><br />

I've also created a webservice (section of it below)

<WebMethod> _
    Public Function GetContinents(knownCategoryValues As String, category As String) As CascadingDropDownNameValue()

        Dim Sql As Object

        Dim MyConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;  data source=" & Server.MapPath("\App_data\MyDayabase.mdb"))
        MyConnection.Open()

        Sql = " SELECT ContinentName, ContinentID FROM Continents "

        Dim dbcomm As New OleDbDataAdapter(Sql, MyConnection)
        Dim values As New List(Of CascadingDropDownNameValue)()

        Dim dt As New DataTable()
        dbcomm.Fill(dt)

        For Each dr As DataRow In dt.Rows
            Dim continent As String = DirectCast(dr("ContinentName"), String)
            Dim continentId As Integer = CInt(dr("ContinentID"))
            values.Add(New CascadingDropDownNameValue(continent, continentId.ToString()))
        Next

        Return values.ToArray()

    End Function

What I have been really struggling with though is the second part of the webservice to populate the second drop box.

I have two tables in my database

Continents

ContinentID, ContinentName
1, Europe
2, Asia

Countries

CountryID, ContinentID, CountryName
1, 1, England
2, 1, France
3, 2, Japan
4, 2, China 

Please could someone help as to what I should put for GetCountries

Thanks Very Much

Modal Popup Drag/Drop

$
0
0

SO I created a Panel to use to drag my modal popup, but any movement of it when you release the mouse it returns back to it's original position. ANy idea what causes this behavior and how to stop it? Using Master Pages, but staying inside the content area.

<asp:Panel ID="pnlOwner" CssClass="pnlBackGround" runat="server" Width="450px"><asp:Panel ID="pnlOwnerDrag" runat="server"><b>Select Endorsements:</b>  </asp:Panel><div id="divOwner" style="height: 250px; overflow: auto;"><asp:CheckBoxList ID="cblOwnerEndorsementsPop" runat="server"></asp:CheckBoxList></div><br /><asp:Button ID="btnOwnerOk" runat="server" Text="OK" UseSubmitBehavior="False" CausesValidation="false" /><asp:Button ID="btnOwnerHackOk" runat="server" Text="OK" Style="display: none" /><asp:Button ID="btnOwnerCancel" runat="server" Text="Cancel" UseSubmitBehavior="False" /></asp:Panel><asp:ModalPopupExtender ID="mpeOwner" runat="server"
                          PopupControlID="pnlOwner"
                          TargetControlID="btnOwnerHack"
                          BackgroundCssClass="modalBackground"
                          DropShadow="True"
                          OkControlID="btnOwnerHackOk"
                          CancelControlID="btnOwnerCancel"
                          PopupDragHandleControlID="pnlOwnerDrag"
                          Enabled="True"></asp:ModalPopupExtender>




Where can I find the control style classes?

$
0
0

In general, I would like the ability to customize the control styles.

Specifically, I want to customize the AjaxFileUpload control.

Where can I find the source style classes?

Thanks in advance!

-Duke

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

RANT

I TOTALLY appreciate all the effort developers have given to create the Ajax Toolkit project.

That being said, why is the documentation so lacking? The sample site is pretty much useless outside of the demos. No one is born with the knowledge on how to implement the controls and we shouldn't have to waste HOURS of time trying to figure things out.

Is it too much to ask for bare-bone examples on:

  • Control Properties
  • Client Event JavaScript Methods
  • Server Event Methods
  • CSS Properties

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

 

 

 

 

 

 

 

AjaxTab Extender

$
0
0

I am having a gridview inside of ajax tabextender and in the gridview there is a button to edit records. But onclick of that button gridview RowEditing event is not firing. So please tell me the reason n hw to overcome from this problem.

making html Editor extender control safe, without sanitizers

$
0
0

I was reading an article on the html Editor extender, which makes a textbox into an editor that produces html.   Its perfect for my site, except for a few problems.  First of all, my site is on a shared public server.  This means I don't have "full trust", which means that the safety against XSS (cross site scripting) can't be put in.  (The safety is a "sanitzer dll that the control is connected to).  So my question is, can I capture the contents of the control in an ASP.net variable, then find some anti-XSS library on the net and apply it to the variable contents, and then store the processed html in a database, for later display on a webpage?

If not, is there a safer alternative to the extender?  For instance, there is an older ajax HTML Editor Control, but I don't know that it is safer.

question

$
0
0

My project is Document Managemnet System

in which I have a login form so users can login to system.

When a user logs in first his/her profile creates

  • Date
  • Full Name
  • User type (e.g. single user)

then he/she uploads a document in document form e.g.

  • Doc name(here user uploads document through BROWSER button)
  • Doc Type(Here is doc type which includes MSWORD,POWERPOINT or PDF)

Then when user uploads the document it must be approved by the manager. When managers logs in to system they will see the following information in their profiles:

  • UserID
  • Create Date
  • User Type (e.g. manager)
  • Dep Type (e.g. finance, marketing, etc)

Then I would like to notify the manager about the recent uploaded documents so that they can approve them. How can I implement such notification system in my application GUI? 

plzz help ....

Problem with calculating difference between 2 textbox - ajax enabled datetime picker

$
0
0

HI

I have 2 textboxes, both of which have been enabled with Ajax datetimepicker calendar tool. The textboxes would display the time and date in this format "dd-mm-yy hh:mm am/pm"      An example of the text would be "06-03-2013 12:00pm" . What I would like to do is, to get the difference between the two dates in the 3rd textbox.

I came across examples that use TimeSpan. I have done this so far

protected void Button1_Click(object sender, EventArgs e)
    {
        DateTime D1 = DateTime.Parse(datepicker.Text);
        DateTime D2 = DateTime.Parse(datepicker1.Text);

        TimeSpan TextBox1 = D2.Subtract(D1);
    }

I think it is not working because of this formatting. How do I correct the code above. I would like to have the code to return the following upon Button1_Click.

Value of 1st Text box = 06-03-2013 12:00pm

Value of 2nd Text box = 06-03-2013 4:30pm

Value of 3rd Text box should be = 4.30

Seadragon Ajax

$
0
0

Helloo friends,

i have images path in my mssql database and i want to use Seadragon to display high def on those images using vb.net code.

Is there any way to do it.. 

ex: each employee has a pic.. when an administrator is lookin at the pic which is already loaded from the database to the form, he should be able to zoom on the photo using seadragon...

is there a solution with vb.net code

thanks in advance

Why does this code work in server-side code, but not in a class?

$
0
0

Using ASP.NET 3.5 created in VS 2008

I have code that builds a message box, that was written by a former co-worker. I use it on all my web forms where I want a message box. it works perfectly when the code is on each form.

I've tried to put the server-side code into a class, and call it from the class. When the code is called, the web form otherwise works correctly, and no error messages appear, but neither does the message box.

Here's the html code:

<body style="background-color: #ccffff">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />

Textboxes, labels, other stuff goes here

<!-- ######################################## POPUP MESSAGE BOX ######################################################## -->
<!--### Include LinkButton as Target Control and Leave out Text to Make it Invisible ###-->
<asp:LinkButton ID="lnkPopup" runat="server" />
<asp:ModalPopupExtender ID="mpeModalWindow" TargetControlID="lnkPopup" PopupControlID="pnlPopup"
runat="server" Drag="True" DropShadow="True" X="-1" Y="-1" Enabled="True" BackgroundCssClass="modalBackground"
PopupDragHandleControlID="pnlPopup" RepositionMode="RepositionOnWindowScroll" />
<!--### X and Y Are Screen Coordinates to Position the Popup Extender and Can Be Set Programmtically in Behind Code ###-->
<!--### The PANEL Will Render the Image (Icon), Text, and Buttons in The ModalPopUp Extender ###-->
<asp:Panel ID="pnlPopup" BackColor="#5BBFB0" Width="300" runat="server" Style="display: none"
CssClass="modalPopup" BorderStyle="Ridge" BorderWidth="5">
<!--### Ajax Update Panel ###-->
<asp:UpdatePanel ID="updatePanel2" runat="server">
<ContentTemplate>
<div class="divHeader" style="line-height: 30px">
<!--### The Message Box Display Header ###-->
<asp:Image ID="Images" runat="server" ImageUrl="" Height="30px" Width="30px" ImageAlign="Left" />
<asp:Label ID="lbl_Header" runat="server" Width="240px" ForeColor="#FFFF66" Font-Bold="True"
Font-Size="Large" CssClass="boxHeader" />
</div>
<br />
<div class="boxHeader">
<!--### Message Box Message Area ###-->
<asp:Label ID="lbl_BoxMessage" runat="server" Width="260" />
</div>
<br />
<div class="boxHeader">
<!--### Message Box Button Area ###-->
<asp:Button ID="btn_OK" Text="OK" runat="server" OnClick="btnOK_Cancel_Click" BorderStyle="Outset"
BackColor="#CCCCCC" ForeColor="#993300" Width="65px" CausesValidation="False" />
<asp:Button ID="btn_Cancel" Text="Cancel" OnClick="btnOK_Cancel_Click" runat="server"
BorderStyle="Outset" BackColor="#CCCCCC" ForeColor="#993300" Width="65" />
</div>
<br />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<!-- ############################################################################################################################# -->
</form>
</body>

Here is the server side code:

protected void BuildMsgBox(string title, string msg, string icon)
{
//*** Set the Appearance of the Modal Popup Control ***

Image errorImg = (Image)pnlPopup.FindControl("Images");
Label lblMsgBox = (Label)pnlPopup.FindControl("lbl_BoxMessage");
Label lblHeader = (Label)pnlPopup.FindControl("lbl_Header");
Button cancelButton = (Button)pnlPopup.FindControl("btn_Cancel");
Button OKButton = (Button)pnlPopup.FindControl("btn_OK");

lblHeader.Text = title;
lblMsgBox.Text = msg;
errorImg.ImageUrl = icon;
cancelButton.Visible = false;
mpeModalWindow.Show();

}

protected void btnOK_Cancel_Click(object sender, EventArgs e)
{

Button theBtn = (Button)sender;


if (theBtn.ID == "btn_OK")
{
mpeModalWindow.Hide();
}

}

Here I'm calling it from within a button on_click event:

snip...

if (dateCompare > 0)
{
title = "Invalid selection!";
msg = "The ending month must be later than the starting month.";
icon = "IconImages/warning.ico";
BuildMsgBox(title, msg, icon);
}

Now here is the code put into methods in a class:

using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for MessageBox
/// </summary>
public static class MessageBox
{
public static void BuildMsgBox(string title, string msg, string icon)

{
Page page = HttpContext.Current.Handler as Page; //Reference to the calling form


Panel pnlPopup = HttpContext.Current.Handler as Panel;

AjaxControlToolkit.ModalPopupExtender mpeModalWindow = HttpContext.Current.Handler as AjaxControlToolkit.ModalPopupExtender;


//*** Set the Appearance of the Modal Popup Control ***

Image errorImg = (Image)pnlPopup.FindControl("Images");
Label lblMsgBox = (Label)pnlPopup.FindControl("lbl_BoxMessage");
Label lblHeader = (Label)pnlPopup.FindControl("lbl_Header");
Button cancelButton = (Button)pnlPopup.FindControl("btn_Cancel");
Button OKButton = (Button)pnlPopup.FindControl("btn_OK");

lblHeader.Text = title;
lblMsgBox.Text = msg;
errorImg.ImageUrl = icon;
cancelButton.Visible = false;

mpeModalWindow.Show();

}

public static void btnOK_Cancel_Click(object sender, EventArgs e)
{
Page page = HttpContext.Current.Handler as Page; //Reference to the calling form
AjaxControlToolkit.ModalPopupExtender mpeModalWindow = HttpContext.Current.Handler as AjaxControlToolkit.ModalPopupExtender;
Button theBtn = HttpContext.Current.Handler as Button;

if (theBtn.ID == "btn_OK")
{
mpeModalWindow.Hide();
}

}
}

And here it is being called from within the same button on_click event as above:

snip...

if (dateCompare > 0)
{
title = "Invalid selection!";
msg = "The ending month must be later than the starting month.";
icon = "IconImages/warning.ico";

MessageBox.BuildMsgBox(title, msg, icon);


CollapsiblePanelExtender Height Issue

$
0
0

Hi All,

I am facing this problem in couple of places in my project. I have one header panel and one content panel and I have placed CollapsiblePanelExtender on it it works fine if its collasped but doesn't show all the data or his genertaed div's height is fixed like 200px or something. Now if I collapse it and expand it again it works perfectly fine... 

Here is my code : 

<asp:Panel runat="server" ID="pnlFinancialBenefits" Visible="false"><!--#include file="../Common/PanelHeader2.inc"--><asp:Panel ID="pnlBenefits" CssClass="pnl_header_blue b_b" runat="server"><div style="cursor: pointer; vertical-align: middle;"><div class="f_l"><asp:Label ID="lblYearBenefits" runat="server" Text="Business Opportunity Summary"></asp:Label></div><div class="f_r arrow_pos"><asp:ImageButton ID="imgBtnBenefits" runat="server" CssClass="upArrow" AlternateText="(Show Details...)" /></div></div></asp:Panel><asp:Panel ID="dataPanelBenefits" runat="server" CssClass="contents_pnl" Height="0"><asp:Timer ID="TimerBenefits" runat="server" Interval="1" OnTick="TimerBenefits_Tick" /><div id="divLoadingBenefits" style="text-align: center;" runat="server"><asp:Image ID="Image1" runat="server" SkinID="loaderImageSkin"/></div><table id="tblBenefits" border="0" cellspacing="0" cellpadding="0" visible="false"
                                    runat="server"><tr><td align="left"><div style="height: 7px;"></div></td></tr><tr><td style="width: 100%"><ucSummary:ucSummary ID="ucSummary" runat="server" Visible="false" /></td></tr><tr><td align="left"><div style="height: 10px;"></div></td></tr></table><ajaxToolkit:CollapsiblePanelExtender ID="CPanelExtendBenefits" runat="Server" TargetControlID="dataPanelBenefits" ExpandedSize="0"
                                    ExpandControlID="pnlBenefits" CollapseControlID="pnlBenefits" ImageControlID="imgBtnBenefits"
                                    ExpandedText="(Hide Details...)" CollapsedText="(Show Details...)" ExpandedImage="../Images/up_normal.gif"
                                    CollapsedImage="../Images/down_normal.gif" Collapsed="False" SuppressPostBack="true" /></asp:Panel><!--#include file="../Common/PanelFooter2.inc"--></asp:Panel>

Any help will be much appriciated. 

Thanks,

Attiqe

Uploaded file size is 0kb when uploading a file bigger than 100kb

$
0
0

When I try to upload a file that is 150kb (or bigger) then the file gets created on the server but its 0kb big but when I try to upload a file that is 40kb then the upload works fine (onto the server)

Any ideas.

Incase your wondering. I have set the web.config file...

<httpRuntime maxRequestLength="20408576" executionTimeout="6400" maxQueryStringLength="2048" enableHeaderChecking="false" />

I've also set...

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true">
     </modules>
    <security>
      <requestFiltering allowDoubleEscaping="true">
        <requestLimits maxAllowedContentLength="52428800"></requestLimits>
      </requestFiltering>
    </security>
  </system.webServer>

I have also set all the permission to that folder.

Please note that there is no error messages anywhere.

Problem with Accordion and Datasources in different Panes

$
0
0

I'm getting errors after introducing Accordion/Accordion Panes into my code.

Can I get some assistance with this? I'm new to ASP.NET so I am still learning how to use its features.

This is the error:

Could not find control 'ProjInfoGridView' in ControlParameter 'ProjectNum'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'ProjInfoGridView' in ControlParameter 'ProjectNum'.

This is my code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Projects.aspx.cs" Inherits="MOSDP.Projects" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:Accordion ID="Accordion1" runat="server"><Panes><asp:AccordionPane ID="AccordionPane1" runat="server"><Header><h2>Project List</h2></Header><Content><%-- PROJECT LIST --%><%-- PROJECT LIST --%><%-- PROJECT LIST --%><asp:EntityDataSource ID="ProjInfoDataSource" runat="server" 
        ContextTypeName="MOSDP.DAL.DPEntities"
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="ProjectInfoes"></asp:EntityDataSource><br /><h2>Project List</h2><br /><asp:GridView ID="ProjInfoGridView" runat="server" 
        DataSourceID="ProjInfoDataSource" AutoGenerateColumns="False" 
        DataKeyNames="ProjectNum" AllowPaging="True"><Columns><asp:CommandField ShowSelectButton="True" /><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" ReadOnly="True" 
                SortExpression="ProjectNum" /><asp:BoundField DataField="ProjectName" HeaderText="ProjectName" 
                SortExpression="ProjectName" /><asp:BoundField DataField="DateCreated" HeaderText="DateCreated" 
                SortExpression="DateCreated" /><asp:BoundField DataField="LastUpdated" HeaderText="LastUpdated" 
                SortExpression="LastUpdated" /><asp:BoundField DataField="Balance" HeaderText="Balance" 
                SortExpression="Balance" /><asp:BoundField DataField="CabinetApprSum" HeaderText="CabinetApprSum" 
                SortExpression="CabinetApprSum" /><asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /></Columns><EmptyDataTemplate>
            There are no records in this list.</EmptyDataTemplate></asp:GridView><br /><asp:DetailsView ID="ProjInfoDetailsView" runat="server" Height="50px" Width="125px" 
        AllowPaging="True" AutoGenerateRows="False" DataKeyNames="ProjectNum" 
        DataSourceID="ProjInfoDataSource" DefaultMode="Insert"><Fields><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" ReadOnly="True" 
                SortExpression="ProjectNum" /><asp:BoundField DataField="ProjectName" HeaderText="ProjectName" 
                SortExpression="ProjectName" /><asp:BoundField DataField="DateCreated" HeaderText="DateCreated" 
                SortExpression="DateCreated" /><asp:BoundField DataField="LastUpdated" HeaderText="LastUpdated" 
                SortExpression="LastUpdated" /><asp:BoundField DataField="Balance" HeaderText="Balance" 
                SortExpression="Balance" /><asp:BoundField DataField="CabinetApprSum" HeaderText="CabinetApprSum" 
                SortExpression="CabinetApprSum" /><asp:TemplateField HeaderText="Type" SortExpression="Type"><EditItemTemplate><asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Type") %>'></asp:TextBox></EditItemTemplate><InsertItemTemplate><asp:DropDownList ID="DropDownList1" runat="server" 
                        SelectedValue='<%# Bind("Type") %>'><asp:ListItem>CF</asp:ListItem><asp:ListItem>IDF</asp:ListItem></asp:DropDownList></InsertItemTemplate><ItemTemplate><asp:Label ID="Label1" runat="server" Text='<%# Bind("Type") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:CommandField ShowInsertButton="True" /></Fields></asp:DetailsView></Content></asp:AccordionPane><asp:AccordionPane ID="AccordionPane2" runat="server"><Header><h2>Add a Document</h2></Header><Content><%-- DOCUMENT --%><%-- DOCUMENT --%><%-- DOCUMENT --%><br /><h2>Add a Document</h2><asp:EntityDataSource ID="DocEntityDataSource" runat="server" 
        ContextTypeName="MOSDP.DAL.DPEntities" 
        EnableFlattening="False" EntitySetName="Documents" EnableInsert="True" 
        Where="it.ProjectNum = @ProjectNum"><WhereParameters><asp:ControlParameter ControlID="ProjInfoGridView" Name="ProjectNum" 
                PropertyName="SelectedValue" Type="Int32" /></WhereParameters></asp:EntityDataSource><br /><asp:GridView ID="DocGridView" runat="server" AllowPaging="True" 
        DataSourceID="DocEntityDataSource" AutoGenerateColumns="False" 
        DataKeyNames="DocumentID"><Columns><asp:BoundField DataField="DocumentID" HeaderText="DocumentID" ReadOnly="True" 
                SortExpression="DocumentID" /><asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" 
                SortExpression="ProjectNum" /></Columns><EmptyDataTemplate>
            There are no records in this list.</EmptyDataTemplate></asp:GridView><br /><asp:DetailsView ID="DocDetailsView" runat="server" Height="50px" Width="125px" 
        AutoGenerateRows="False" DataKeyNames="DocumentID" 
        DataSourceID="DocEntityDataSource" DefaultMode="Insert"><Fields><asp:BoundField DataField="DocumentID" HeaderText="DocumentID" ReadOnly="True" 
                SortExpression="DocumentID" /><asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /><asp:TemplateField HeaderText="ProjectNum"><InsertItemTemplate><asp:EntityDataSource ID="ProjDDLEntityDataSource" runat="server" ConnectionString="name=DPEntities" 
                    DefaultContainerName="DPEntities" EnableDelete="True" EnableFlattening="false" EntitySetName="ProjectInfoes" EntityTypeFilter="ProjectInfo"></asp:EntityDataSource><asp:DropDownList ID="ProjInfoesDropDownList" runat="server"
                        DataSourceID="ProjDDLEntityDataSource" DataTextField="ProjectNum" 
                        DataValueField="ProjectNum" OnInit="ProjInfoesDropDownList_Init"></asp:DropDownList></InsertItemTemplate></asp:TemplateField><asp:CommandField ShowInsertButton="True" /></Fields></asp:DetailsView></Content></asp:AccordionPane><asp:AccordionPane ID="AccordionPane3" runat="server"><Header><h2>Add an Allocation</h2></Header><Content><%-- ALLOCATION --%><%-- ALLOCATION --%><%-- ALLOCATION --%><br /><h2>Add an Allocation</h2><asp:EntityDataSource ID="AllocEntityDataSource" runat="server" 
        ContextTypeName="MOSDP.DAL.DPEntities" 
        EnableFlattening="False" EntitySetName="Allocations"
        Where="it.ProjectNum = @ProjectNum" ConnectionString="name=DPEntities" 
        DefaultContainerName="DPEntities" EnableInsert="True"><WhereParameters><asp:ControlParameter ControlID="ProjInfoGridView" Name="ProjectNum" 
                PropertyName="SelectedValue" Type="Int32" /></WhereParameters></asp:EntityDataSource><br /><asp:GridView ID="AllocGridView" runat="server" 
        DataSourceID="AllocEntityDataSource" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="AllocationID"><Columns><asp:BoundField DataField="AllocationID" HeaderText="AllocationID" 
                ReadOnly="True" SortExpression="AllocationID" /><asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year" /><asp:BoundField DataField="OriginalAlloc" HeaderText="OriginalAlloc" 
                SortExpression="OriginalAlloc" /><asp:BoundField DataField="RevisedAlloc" HeaderText="RevisedAlloc" 
                SortExpression="RevisedAlloc" /><asp:BoundField DataField="Balance" HeaderText="Balance" 
                SortExpression="Balance" /><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" 
                SortExpression="ProjectNum" /></Columns><EmptyDataTemplate>
            There are no records in this list.</EmptyDataTemplate></asp:GridView><br /><asp:DetailsView ID="AllocDetailsView" runat="server" Height="50px" 
        Width="125px" AutoGenerateRows="False" DataKeyNames="AllocationID" 
        DataSourceID="AllocEntityDataSource" DefaultMode="Insert"><Fields><asp:BoundField DataField="AllocationID" HeaderText="AllocationID" 
                ReadOnly="True" SortExpression="AllocationID" /><asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year" /><asp:BoundField DataField="OriginalAlloc" HeaderText="OriginalAlloc" 
                SortExpression="OriginalAlloc" /><asp:BoundField DataField="RevisedAlloc" HeaderText="RevisedAlloc" 
                SortExpression="RevisedAlloc" /><asp:BoundField DataField="Balance" HeaderText="Balance" 
                SortExpression="Balance" /><asp:TemplateField HeaderText="ProjectNum" SortExpression="ProjectNum"><InsertItemTemplate><asp:EntityDataSource ID="ProjAllocDDLEntityDataSource" runat="server" 
                        ConnectionString="name=DPEntities" DefaultContainerName="DPEntities" 
                        EnableFlattening="False" EntitySetName="ProjectInfoes" 
                        EntityTypeFilter="ProjectInfo" EnableDelete="True"></asp:EntityDataSource><asp:DropDownList ID="ProjInfoesDropDownList2" runat="server" 
                        DataSourceID="ProjAllocDDLEntityDataSource" DataTextField="ProjectNum" 
                        DataValueField="ProjectNum" OnInit="ProjInfoesDropDownList2_Init"></asp:DropDownList></InsertItemTemplate></asp:TemplateField><asp:CommandField ShowInsertButton="True" /></Fields></asp:DetailsView></Content></asp:AccordionPane><asp:AccordionPane ID="AccordionPane4" runat="server"><Header><h2>Add a Loan</h2></Header><Content><%-- LOAN --%><%-- LOAN --%><%-- LOAN --%><br /><h2>Add a Loan</h2><asp:EntityDataSource ID="LoanEntityDataSource" runat="server" 
        ContextTypeName="MOSDP.DAL.DPEntities" 
        EnableFlattening="False" EntitySetName="Loans"
        Where="it.ProjectNum = @ProjectNum" ConnectionString="name=DPEntities" 
        DefaultContainerName="DPEntities" EnableInsert="True"><WhereParameters><asp:ControlParameter ControlID="ProjInfoGridView" Name="ProjectNum" 
                PropertyName="SelectedValue" Type="Int32" /></WhereParameters></asp:EntityDataSource><br /><asp:GridView ID="LoanGridView" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="LoanID" 
        DataSourceID="LoanEntityDataSource"><Columns><asp:BoundField DataField="LoanID" HeaderText="LoanID" ReadOnly="True" 
                SortExpression="LoanID" /><asp:BoundField DataField="Institution" HeaderText="Institution" 
                SortExpression="Institution" /><asp:BoundField DataField="Amount" HeaderText="Amount" 
                SortExpression="Amount" /><asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" /><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" 
                SortExpression="ProjectNum" /></Columns><EmptyDataTemplate>
            There are no records in this list.</EmptyDataTemplate></asp:GridView><br /><asp:DetailsView ID="LoanDetailsView" runat="server" Height="50px" 
        Width="125px" DefaultMode="Insert" AutoGenerateRows="False" 
        DataKeyNames="LoanID" DataSourceID="LoanEntityDataSource"><Fields><asp:BoundField DataField="LoanID" HeaderText="LoanID" ReadOnly="True" 
                SortExpression="LoanID" /><asp:BoundField DataField="Institution" HeaderText="Institution" 
                SortExpression="Institution" /><asp:BoundField DataField="Amount" HeaderText="Amount" 
                SortExpression="Amount" /><asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" /><asp:BoundField DataField="ProjectNum" HeaderText="ProjectNum" 
                SortExpression="ProjectNum" /><asp:CommandField ShowInsertButton="True" /></Fields></asp:DetailsView></Content></asp:AccordionPane></Panes></asp:Accordion></asp:Content>

Thanks in advance.


Modal pop up inside a UserControl

$
0
0

Is it possible to have a Modal pop up inside a UserControl with 4 buttons and then use that UserControl on a web form without the pop up closing on postback whenever one of those buttons are clicked? In other words the form/Modal pop would remain open?

Thanks

ICallBackContainer vs ICallBackEventHandler

$
0
0

ICallBackContainer is a complement of ICallBackEventHandler Interface.

So can i use ICallBackContainer alone for making call backs for a control without implementing ICallBackEventHandler in my Page?

Viewing all 5678 articles
Browse latest View live


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