Articles tagged with: ASP.NET AJAX
ASP.Net, Tech Corner »
How to Upload a file in an ASP.NET website…???
Pre-requisites
1)Drag & drop the “Fileupload” control (“FileUpload1”)into an aspx page(“latest15.aspx” ).You will get “Fileupload” control from visualstudio.Net standard toolbar.
2)Add a button to the page( “Button_Upload”) .
The fileupload control itself helps browsing our system,I am not going on explaining just check out the code below.It is the code file of the page.
“latest15.aspx.cs”
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class latest15 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button_Upload_Click(object sender, EventArgs e)
{
FileUpload1.SaveAs(Server.MapPath(Request.ApplicationPath)+”\\”+FileUpload1.FileName);
}
}
Notes:
1) “Savesas” …
ASP.NET AJAX, Tech Corner »
To add collapsible sections to your webpage,Ajax provides you with the CollapsiblePanel control.
<asp:LinkButton ID=”LinkButton1″ runat=”server”>Show Details</asp:LinkButton>
<ajaxToolkit:CollapsiblePanelExtender ID=”cpe” runat=”Server”
TargetControlID=”Panel1″ CollapsedSize=”0″
ExpandedSize=”300″
Collapsed=”True”
ExpandControlID=”LinkButton1″
CollapseControlID=”LinkButton1″
AutoCollapse=”False”
AutoExpand=”False”>
</ajaxToolkit:CollapsiblePanelExtender>
<asp:Panel ID=”Panel1″ runat=”server” >
To add collapsible sections to your webpage,Ajax provides you with the CollapsiblePanel control.
</asp:Panel>
ASP.NET AJAX, Tech Corner »
TextBoxWatermarkExtender is a control which can be applied to a textbox to get a watermark behaviour.
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID=”TBWE2″ runat=”server”
TargetControlID=”TextBox1″
WatermarkText=”Type First Name Here”>
</ajaxToolkit:TextBoxWatermarkExtender>
ASP.NET AJAX, Tech Corner »
The ValidatorCalloutExtender control in Ajax extends the functionality of the existing ASP.NET validation controls.
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>
<asp:Button ID=”Button1″ runat=”server” Text=”Button” />
<asp:RequiredFieldValidator ID=”RFD” runat=”server”
ControlToValidate=”TextBox1″ ErrorMessage=”Textbox should not be empty” Display=”None”></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender
runat=”Server”
ID=”ValidatorCalloutExtender 1″
TargetControlID=”RFD”
Width=”350px”/>
ASP.NET AJAX, Tech Corner »
The Accordion is a web control that allows you to provide multiple panes and display them one at a time.It is like having several CollapsiblePanels where only one can be expanded at a time.
<ajaxToolkit:Accordion ID=”MyAccordion” runat=”server” SelectedIndex=”0″
FadeTransitions=”false” FramesPerSecond=”40″ TransitionDuration=”250″
AutoSize=”None” RequireOpenedPane=”false” SuppressHeaderPostbacks=”true”>
<Panes>
<ajaxToolkit:AccordionPane ID=”AccordionPane1″ runat=”server”>
<Header><a href=”">1. AccordionPane1</a></Header>
<Content>
Type your content here</Content>
</ajaxToolkit:AccordionPane>
<ajaxToolkit:AccordionPane ID=”AccordionPane2″ runat=”server”>
<Header><a href=”">2. AccordionPane2</a></Header>
<Content>
content goes here
</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>
Read the full Post »