hi.. anyone can help me to convert asp.net program to pdf? before this i'm using this code [CODE]private void ExportGridView() { string attachment = "attachment; filename=Contacts.xls"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); GridView1.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); }[/CODE] to convert to excel.. can i just modify this code?

Member Avatar
Member Avatar
+0 forum 2

i want to make a seacrh page using c# in asp.net.. at the first page, i want to display all the record in a gridview..then,after user click a search button, the result will appear in another gridview.. what should i put to visible the previous gridview and display only the result.. here are my code: [CODE]<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="search.aspx.cs" Inherits="search" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> <asp:TextBox ID="catID" runat="server" MaxLength="1"></asp:TextBox><asp:Button ID="button2" runat="server" Text="Search" onclick="button2_Click" /><br /> <asp:CompareValidator ID="CompareValidator1" runat="server" Text="Please Enter the Category ID" ControlToValidate="catID" Type="Integer" Operator="DataTypeCheck"></asp:CompareValidator> <asp:GridView ID="GridView1" runat="server" DataKeyNames="categoryID" AutoGenerateColumns="false"> <Columns> …

Member Avatar
Member Avatar
+0 forum 3

hi.. i've review the latest logout and cannot back if BACK button is press.. anyone can help me in clearly how to code it?

Member Avatar
Member Avatar
+0 forum 6

Hi all, i am working on converting the asp.net to pdf file.. now i'm using this code,but it give me an error "Type or namaspace name 'pdfConverter' could not be found".. is there any component i need to install..any help plz? [CODE]PdfConverter pdfConverter = new PdfConverter(); pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal; pdfConverter.PdfDocumentOptions.ShowHeader = true; pdfConverter.PdfDocumentOptions.ShowFooter = true; pdfConverter.PdfDocumentOptions.LeftMargin = 5; pdfConverter.PdfDocumentOptions.RightMargin = 5; pdfConverter.PdfDocumentOptions.TopMargin = 5; pdfConverter.PdfDocumentOptions.BottomMargin = 5; pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = true; pdfConverter.PdfDocumentOptions.ShowHeader = false; //pdfConverter.PdfHeaderOptions.HeaderText = "Sample header: " + TxtURL.Text; //pdfConverter.PdfHeaderOptions.HeaderTextColor = Color.Blue; //pdfConverter.PdfHeaderOptions.HeaderDescriptionText = string.Empty; //pdfConverter.PdfHeaderOptions.DrawHeaderLine = false; pdfConverter.PdfFooterOptions.FooterText = "Sample footer: " + TxtURL.Text + …

Member Avatar
Member Avatar
+0 forum 3

hi all, i'm going to make an upload picture into database.. in run successfully but now it will store as [CODE] C:\Users\itdept\Desktop\webmaster\image\Desert.jpg [/CODE] but i just want to make it like this [CODE] ~/image/Desert.jpg [/CODE] is it possible?

Member Avatar
Member Avatar
+0 forum 6

Hi now, when i download the image, the path will be in this format [CODE]C:\Users\itdept\Desktop\webmaster\image\Penguins.jpg[/CODE] how can i make it save only the filename [CODE]Penguins.jpg[/CODE]? this is my code [CODE] if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "") { byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength]; HttpPostedFile uploadedImage = FileUpload1.PostedFile; uploadedImage.InputStream.Read(imageSize, 0, (int)FileUpload1.PostedFile.ContentLength); string ImagePath = FileUpload1.PostedFile.FileName.Trim(); [/CODE]

Member Avatar
Member Avatar
+0 forum 2

hi all.. i'm working with slide show extender.. i'm referred to this website [URL="http://www.dotnetspider.com/resources/27734-Ajax-slide-show.aspx"]http://www.dotnetspider.com/resources/27734-Ajax-slide-show.aspx[/URL] on how to make it.. it is completely tell the way to make it but i want to modified it to make it suitable with my requirement.. this is the code [CODE] using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; //using FidesTech; public partial class slideShowExtender2 : System.Web.UI.Page { private static DataTable tblData = new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack)return; SqlConnection db = new SqlConnection(); string strSQL …

Member Avatar
Member Avatar
+0 forum 1

Hi all.. i'm working with asp.net c#.. i want to make a chart that can retrieve the data from the database.. i found one website that tell the way to make it but i dont understand the query used.. this the the link [URL="http://www.dotnetcurry.com/ShowArticle.aspx?ID=238"]http://www.dotnetcurry.com/ShowArticle.aspx?ID=238[/URL] and the query is [CODE]SELECT CategoryName, COUNT(*) AS ProductCount FROM Products JOIN Categories ON Products.CategoryID = Categories.CategoryID GROUP BY CategoryName [/CODE] anyone can help me translate this query.. 1) COUNT(*) is count for the productCount or categoryName? 2) is it necessary to include the join? 3) ProductCount is the attribute that we need to create to …

Member Avatar
Member Avatar
+0 forum 1

Hi I am using Ajax Slide Show extender to show my images. Everything works fine. Now what I want is when the anyone clicks on any particular image it should show them that particular image in another window or popup etc. this is code when user click the image but i dont know then [CODE] <asp:ImageButton ID="imgShowImage" runat="server" Height="300" Style="border: 1px solid black;width:auto" AlternateText="" onclick="imgShowImage_Click"/> <asp:Label runat="Server" ID="imageLabel1"/><br /> <asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Small" /> <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Small" /> <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Small" /> <ajax:SlideShowExtender ID="slideshowextend1" runat="server" TargetControlID="imgShowImage" SlideShowServiceMethod="GetSlides" AutoPlay="true" ImageDescriptionLabelID="imageLabel1" NextButtonID="nextButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton" PlayButtonID="playButton" Loop="true" …

Member Avatar
+0 forum 0

hi, i have a problem with my tabcontainer that once user click the tab, it will not remains the tab but goes to the default tab.. This is my code [CODE] <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager> <cc1:TabContainer ID="MyTabContainer" runat="server" ActiveTabIndex="0> <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Company"> <ContentTemplate> <a href="<%= Page.ResolveUrl("~")%>MASTER/Company_a.aspx" >Company Entry</a>&nbsp;&nbsp;&nbsp; <a href ="<%= Page.ResolveUrl("~")%>MASTER/Company_v.aspx">View Company </a>&nbsp;&nbsp;&nbsp; </ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="User"> <ContentTemplate> <a href ="<%= Page.ResolveUrl("~")%>MASTER/User_a.aspx">User Entry </a>&nbsp;&nbsp;&nbsp; <a href ="<%= Page.ResolveUrl("~")%>MASTER/User_v.aspx">View User </a> </ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3"> <ContentTemplate> Tab 3 </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> [/CODE]

Member Avatar
Member Avatar
+0 forum 4

Hi all.. i want to create a banner in my website using asp.net and ajax.. banner will consist of many banners and have the paging under the banner that moving y itself.. what we call it? i cannot find any other example yet because i dont know the name of that application..

Member Avatar
Member Avatar
+0 forum 2

Hi all, i havw make a page for user entry..now i'm uisng [CODE] <asp:RequiredFieldValidator ID="CmpCode" ErrorMessage="*" runat="server" ControlToValidate="txtCmpCode"></asp:RequiredFieldValidator> [/CODE] to make a validation but not enough space.. anybody have any suggestion to make a validation rather than diaplay the error message? i'm thinking about just red bold the textbox but not found yet.. anybody knows?

Member Avatar
Member Avatar
+0 forum 2

Hi all, i'm doing a program using c# in creating an insert page.. i want to insert the zip code into the databse and have been validate using validation expression.. [CODE] <asp:TextBox ID="txtCmpZip" runat="server" BorderStyle="Groove" MaxLength="10" Width="74"></asp:TextBox><asp:RequiredFieldValidator ID="CmpZip" runat="server" ErrorMessage="*" ControlToValidate="txtCmpZip"></asp:RequiredFieldValidator> <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID="RegularExpressionValidator2"></asp:ValidatorCalloutExtender> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ErrorMessage="Zip code must at least 5 digits" ValidationExpression="\d{5,10}" Display="None" runat="server" ControlToValidate="txtCmpZip"></asp:RegularExpressionValidator> [/CODE] when i insert "999999999", it will giving me an error said [CODE] error converting data type nvarchar to int. [/CODE] but for the other zip code, it will insert successfully.. any help plz?

Member Avatar
Member Avatar
+0 forum 6

Hi all, i need some help in c# in order to display the attrtibute that is not in the same table.. i have a table COMPANY and CODE..in company table, i have attribute called CmpStatusCode that just display in int (input by ddl which is selectedvalue ex: 1,2,3)..but in CODE table, there are definition for that selectedvalue (ex: 1=active , 2=not active).. what should i do to display the value of "active" by refering to 1,2,3? i'm using usp.. i'm using datagrid to display the data.. [CODE] <asp:TemplateColumn HeaderText="Status" HeaderStyle-Width="5%" SortExpression="CmpStatusCode" visible="true"> <ItemTemplate> <center><asp:Label Id="lblCmpStatusCode" width="50px" Text='<%# DataBinder.Eval(Container, "DataItem.CmpStatusCode") %>' …

Member Avatar
Member Avatar
+0 forum 4

Hi all, i have a problem with my datagrid attribute "OnPageIndexChanged="gridedit_PageIndexChanged""... for example if i have 2 page and the second page contain only one record.. if i want to delete the record, this error appear.. anyone can help me plz.. [CODE] Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. [/CODE]

Member Avatar
+0 forum 0

Hi all, now i'm working to convert html to pdf in asp.net.. i don't have any idea to make it.. now i have this code to convert it but have a problem.. anybody please help me see thid code or send me link as a guide.. i'm using iTextSharp to convert it [CODE] protected void btnSubmit_Click(object sender, EventArgs e) { //create document Document document = new Document(); try { //writer - have our own path!!! and see you have write permissions... PdfWriter.GetInstance(document, new FileStream(Server.MapPath("/") + "WordDoc/" + "parsetest.pdf", FileMode.Create)); document.Open(); //html -text - can be from database or editor too …

Member Avatar
+0 forum 0

Hi.. now i'm working with asp.net c#.. i want to view the data from database in the textbox in order to make editing to the data is avaiable..but i'm using user stored procedure.. now this is my code where i want to display the data.. [CODE] <tr> <td class="style1">Company Code </td> <td>:</td> <td> <asp:TextBox ID="txtCmpCode" runat="server" Width="80" BorderStyle="Groove" MaxLength="10" ReadOnly="true"></asp:TextBox Company Name: <asp:TextBox ID="txtCmpName" runat="server" Width="217" BorderStyle="Groove"> </td> </tr> [/CODE] for the back end code is [CODE] protected void Page_Load(object sender, EventArgs e) { string strCompCode = Request.QueryString["comp_code"].ToString(); SearchData(strCompCode); } //SearchData public void SearchData(string CmpCode) { //Define Class gdex gdexClass …

Member Avatar
Member Avatar
+0 forum 8

Hi all, i need some help to carry the data to another page..this is my code to carry the id [CODE] <ASP:HYPERLINK ID="lnkDetails" RUNAT="server" NAVIGATEURL='<%#"Company_vd.aspx?comp_code=" + DataBinder.Eval(Container.DataItem,"CmpCode")%>' TEXT="Details"></ASP:HYPERLINK> [/CODE] it works but i dont know how to use the comp_code on the other page to retrieve other data based on the selected comp_code..it just like view details.. what should i write in the back end code..

Member Avatar
Member Avatar
+0 forum 4

Hi, i want to display several record from database with data type "date"..but when display, the record displayed in datetime format (default)..what should i do to change the format date..i have tried many thing but it does not work.. now, this is mt coding [CODE] <asp:TemplateColumn HeaderText="Expiry date" HeaderStyle-Width="10%" SortExpression="CmpExpDate" visible="true"> <ItemTemplate> <asp:Label Id="lblCmpExpDate" width="100px" Text='<%# DataBinder.Eval(Container, "DataItem.CmpExpDate") %>' Runat="server" /> </ItemTemplate> </asp:TemplateColumn> [/CODE] i dont know then,what should i add to make it function well..please anybody can give me some suggestion..

Member Avatar
Member Avatar
+0 forum 1

Hi all..i need some help please..i'm doing a validation using a validation expression..this is use to make a user just input the digit in 5 digit.. i'm using this now but not function [CODE]<tr> <td class="style1">Zip Code </td> <td>:</td> <td> <asp:TextBox ID="txtCmpZip" runat="server" BorderStyle="Groove" MaxLength="5"></asp:TextBox><asp:RequiredFieldValidator ID="CmpZip" runat="server" ErrorMessage="*" ControlToValidate="txtCmpZip"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ErrorMessage="Zip code must be 5 numeric digits" ValidationExpression="\d{5}" EnableClientScript="False" runat="server" ControlToValidate="txtCmpZip"></asp:RegularExpressionValidator> </td> </tr>[/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hi, now i'm working to export the gridview in asp.net to xml.. anyone have any idea.. just now,this is my code but there is some error that i can't figure out.. [CODE] Response.ContentType = "text/x-json"; XmlDocument xmlToExport = new XmlDocument(); string toExport = MethodToReturnXMLString(id); xmlToExport.LoadXml(toExport); Response.Write(xmlToExport); xmlToExport.Save("Filename.xml"); Response.End(); [/CODE]

Member Avatar
Member Avatar
+0 forum 1

hye all.. now i'm doing an insert statement in asp.net using c#.. how i can make a validation for same data entry? anyones can help me? thanks in asdvance...

Member Avatar
Member Avatar
+0 forum 4

Hi, once page is display, i want to display all record in gridview from database..in the page also has one button to search..then upon the button search is click, i want to display the result in other gridview and hiding the last gridview..how can i do?

Member Avatar
Member Avatar
+0 forum 1

Hi, what should i use to make the data inserted is in all capital letter? here is insert statement: [CODE] string query = "INSERT into Categories values (' " + textbox5_value + " ', ' " + textbox6_value + " ', ' " + textbox7_value + " ' )";[/CODE] strToUpper() is used to make it convert to all capital letter but i don't know where should i put it? can i use this?

Member Avatar
Member Avatar
+0 forum 2

how i can retrive the username from database based on the username and password only to make a welcome at the first page?

Member Avatar
Member Avatar
+0 forum 11

The End.