Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

RajpootRohan

@RajpootRohan
About
Posts
115
Topics
44
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Check for the selection of profile for mail account in control panel
    R RajpootRohan

    Hi to all, I have a scenario: We have a functionality in which we are sending mails through outlook. Now in control panel we do have an option to choose profile(from which profile mail will be sent.). We can select the option "Prompt for a profile to be used". My question is: Can we check that the user has selected the above option or not through coding?

    cheers, sneha

    .NET (Core and Framework) question

  • performance issue
    R RajpootRohan

    Hi to all, I know its a common question. But I want to share something. Actually I am working on e-commerce portal. It consists of 32000 products with around 2500 categories. I used 3-tier architecture for this project. Everything is coming using stored procedures. I used master pages as well. But still I am fighting with the performance issue. Can anyone please tell me some useful steps to increase the speed of the website. Its taking ages to load the pages. waiting for your assistance....

    cheers, sneha

    ASP.NET performance architecture help question

  • Encrypting The string
    R RajpootRohan

    Hi to all, Actually I am working on a e-commerce portal. We are using sage pay (payment gateway) for the transaction.While sending data to sage for transaction, the data should be encrypted. For this data should be encrypted using Simple XOR algorithm and then should be Base64 encoded. Can anyone have any idea about this. I am trying like this:

    public void gencrypt()
    {
        string mycrypt = "";
        key = "EnNj72dXmScJUX45";
        string mystring = strPost;
        string temp = "";
    
        SimpleXor(mystring, key);
        Base64Encode(temp);
    }
    
    public void SimpleXor(string strIn, string strkey)
    {
        int iInIndex;
        int iKeyIndex;
        string strReturn;
    
        if (strIn.Length == 0 || strkey.Length == 0)
        {
            return;
        }
        iInIndex = 1;
        iKeyIndex = 1;
        strReturn = "";
        for (int i = 0; i <= strIn.Length; i++)
        {
            for (int j = 0; j <= strkey.Length;j++ )
            {
                strReturn = strReturn + (strIn\[i\] ^ strkey\[j\]);
                iInIndex = iInIndex + 1;
                if (iKeyIndex == strIn.Length)
                {
                    iKeyIndex = 0;
                    iKeyIndex = iKeyIndex + 1;
                }
            }
        }
    }
    
    public void Base64Encode(string strplain)
    {
    
    }
    

    Please assist me..

    cheers, sneha

    ASP.NET algorithms

  • Formview to PDF
    R RajpootRohan

    Hi to all, I am using formview control to generate invoice. Instead of printing html view , it is printing html code in PDF. I am doing like this:

    public void generate()
    {
    
        MemoryStream m = new MemoryStream();
        Document document = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
        try
        {
            Response.ContentType = "application/pdf";
    
            StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            FormView1.RenderControl(htw);
            string html = sw.ToString() ;
            
    
            StringBuilder str = new StringBuilder();
            str.Append("<h3><b>Online Application Form Details </b></h3>");
            str.Append(html);
    
            PdfWriter writer = PdfWriter.GetInstance(document, m);
            writer.CloseStream = false;
            document.Open();
            document.Add(new Paragraph(str.ToString()));
            
        }
        catch (DocumentException ex)
        {
            Console.Error.WriteLine(ex.StackTrace);
            Console.Error.WriteLine(ex.Message);
        }
        document.Close();
    
        Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
        Response.OutputStream.Flush();
        Response.OutputStream.Close();
        string filename = "~/Invoices/sample.pdf";
        string path = Server.MapPath(filename);
        m.WriteTo(new FileStream(@path, FileMode.Create));
        m.Close(); 
    }
    
    public override void VerifyRenderingInServerForm(Control control)
    {
    
    }
    

    please assist me.....

    cheers, sneha

    ASP.NET html sysadmin help

  • Image upload problem...
    R RajpootRohan

    Imran Khan Pathan wrote:

    If you dont want to update any code, then please check else condition, what does im contain? and after executing else code, please check your folder to verify that file is exist or not. degun the code, you will get an idea.

    I already checked the else condition and on debugging found that "im" contains the correct path. And the image folder still contains the image. But strange behaviour is image disappears. I dont know why it is happening.

    cheers, sneha

    ASP.NET sysadmin help

  • Image upload problem...
    R RajpootRohan

    strange behaviour is that the two paths for the image (one in the label and second when I again choose from the file upload) are same.But the image appears only when the path is choosen from the file upload.

    cheers, sneha

    ASP.NET sysadmin help

  • Image upload problem...
    R RajpootRohan

    Hi, The problem is that in the edit mode of details view a label and a file upload control is shown for the image. In the label control the current path is displayed. If the user doesn't changes the image then the path in label goes in the update function. And if the user changes the file then the path from the file upload control goes. My problem is if the user does not change the image then the path from the label goes well but the image disappears from the front end. If I again choose the path from the file uploader then the image appears.

    cheers, sneha

    ASP.NET sysadmin help

  • Image upload problem...
    R RajpootRohan

    Hi to all, I am using a gridview to display products with a link "view details". When the user clicks on the "view details" for a product, all the details are displayed in the detailsview control. I the edit mode , if user don't want to edit the image, then the initial path saved in the label should go. The path is going but image is not displayed. I am unable to find the problem. Here is the code: <asp:TemplateField HeaderText="Image"> <ItemTemplate> <asp:Label ID="lblimage" runat="server" Text='<%# Eval("image") %>' /> </ItemTemplate> <EditItemTemplate> <asp:Label ID="labelImage" runat="server" Text='<%# Eval("image") %>' /> <asp:FileUpload ID="UpldImage" runat="server" /> </EditItemTemplate> </asp:TemplateField>

        //To upload large image
        FileUpload UpldImage = (FileUpload)DetailsView1.FindControl("UpldImage");
        Label labelImage = (Label)DetailsView1.FindControl("labelImage");
        string im = labelImage.Text;
        if (UpldImage.HasFile)
        {
            string fileName = "~/ProductImages/" + UpldImage.FileName;
            SqlDataSource2.UpdateParameters\["image"\].DefaultValue = fileName;
            UpldImage.SaveAs(Server.MapPath(fileName));
        }
        else
        {
            SqlDataSource2.UpdateParameters\["image"\].DefaultValue = im;
            UpldImage.SaveAs(Server.MapPath(im));
        }
    

    Please assist me...where I am going wrong.

    cheers, sneha

    ASP.NET sysadmin help

  • Import Export Wizard problem
    R RajpootRohan

    Hi friends, I am stucked in a problem. I am trying export the data to the server through export import wizard. The data is going but the primary key and the auto-incrementation on a column was not transfered. I also tried through generating scripts but same results. And on the server there is no provision to restore through .bak file. So please assist me.

    cheers, sneha

    Database sysadmin help

  • DetailsView Update Problem
    R RajpootRohan

    I checked the page source. I think here is the problem. The update button is this: <a href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$DetailsView1$ctl12&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))" style="color:#333333;">Update</a> I think it should be: <a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$DetailsView1$ctl12','')" style="color:Black;">Update</a>

    cheers, sneha

    ASP.NET sysadmin help announcement

  • DetailsView Update Problem
    R RajpootRohan

    Hi Nishant, In the edit mode of the details view we have two buttons, update and cancel. Cancel is working fine. But the update button is not working.It is not clickable. Nothing is happening when I click on it. I even created a new page and applied the same code but of no use. I used details view several times but this time I am not able to solve the problem. If it is not updating the data, I can understand but the update button is not clickable is a strange behaviour.

    cheers, sneha

    ASP.NET sysadmin help announcement

  • DetailsView Update Problem
    R RajpootRohan

    Hi to all, I am using DetailsView control to edit the details of the user. But when I click the Edit button, the update button is not clickable. I am unable to find out the problem. <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px" Width="364px" AutoGenerateEditButton="True" DataKeyNames="UserId" style="margin-right: 0px" onitemupdating="DetailsView1_ItemUpdating"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <Fields> <asp:BoundField DataField="UserId" HeaderText="UserId" ReadOnly="True" SortExpression="UserId" /> <asp:BoundField DataField="first_name" HeaderText="first_name" SortExpression="first_name" /> <asp:BoundField DataField="last_name" HeaderText="last_name" SortExpression="last_name" /> <asp:BoundField DataField="AddressLine1" HeaderText="address1" SortExpression="AddressLine1" /> <asp:BoundField DataField="AddressLine2" HeaderText="address2" SortExpression="AddressLine2" /> <asp:BoundField DataField="AddressLine3" HeaderText="address3" SortExpression="AddressLine3" /> <asp:BoundField DataField="zipcode" HeaderText="zipcode" SortExpression="zipcode" /> <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" /> <asp:BoundField DataField="state" HeaderText="state" SortExpression="state" /> <asp:BoundField DataField="country" HeaderText="country" SortExpression="country" /> <asp:BoundField DataField="landline" HeaderText="landline" SortExpression="landline" /> <asp:BoundField DataField="mobile" HeaderText="mobile" SortExpression="mobile" />

    ASP.NET sysadmin help announcement

  • Apply them only in content page.
    R RajpootRohan

    Hi, You must be having a ContentPlaceHolder tag in the of the master page, you are using. Then in the content page there must be content tag having that contentPlaceHolderID. You can put the link tag in that .

    cheers, sneha

    modified on Tuesday, November 17, 2009 6:14 AM

    ASP.NET help question

  • Advanced search ....
    R RajpootRohan

    Hi, I did that but every time result was all the products.

    ALTER PROCEDURE [dbo].[ap_SearchProduct]
    (
    @productid nvarchar(100) = null,
    @product_type nvarchar(100) = null,
    @sh_desc nvarchar(4000) = null,
    @weight float = null,
    @length float = null,
    @width float = null,
    @height float = null
    )

    as

    SET NOCOUNT ON
    
    SELECT productid,sh\_desc,price FROM PRODUCTS e
        WHERE
    	(@productid IS NULL OR e.productid = @productid)
    	OR (@product\_type IS NULL OR e.product\_type = @product\_type)
    	OR (@sh\_desc IS NULL OR e.sh\_desc = @sh\_desc)
        OR (@weight IS NULL OR e.weight = @weight)
        OR (@length IS NULL OR e.length = @length)
        OR (@width IS NULL OR e.width = @width)
        OR (@height IS NULL OR e.height = @height)
    

    return

    cheers, sneha

    ASP.NET database

  • Advanced search ....
    R RajpootRohan

    Ok I got it. I will try like this and came back to you with the results. :)

    cheers, sneha

    ASP.NET database

  • Apply them only in content page.
    R RajpootRohan

    Hi, You can write this in <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> of the content page.

    cheers, sneha

    ASP.NET help question

  • Advanced search ....
    R RajpootRohan

    you mean to say if I have 3 fields. Then I should use all the permutations and combinations. That is if all three are filled none is filled 1 is not filled , 2 & 3 are filled . . . . .

    cheers, sneha

    ASP.NET database

  • Advanced search ....
    R RajpootRohan

    Hi Amit, Thanks for the reply. I am the count of the values filled by the user through arraylist. Suppose I get 3 values but how I will know that these 3 values are which values. Is it a product id, description and short description or it is price, weight and length. Please provide me an example if you have..I am confused..

    cheers, sneha

    ASP.NET database

  • Advanced search ....
    R RajpootRohan

    Hi to all, I am working on an advanced search module. It consist of 6 fields given to user to fill and search. The user can fill any one or two and may be all the fields to search. Some fields are text based and some are float. The logic is that after taking the input, the application should check which fields are filled up by the user. And neglect the fields which are not filled from the sql query. What I did is that, I fetched all the values from the textboxes and the values which are not empty has been added to a arraylist. Now I got the filledup values. But application will know that it is productid, description or what... Please assist me.

    protected void Button1\_Click(object sender, EventArgs e)
    {
    
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings\["newcon"\].ConnectionString);
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
    
        //find out which feilds are not null, then make search on the basis of those feilds
        //Now the feilds which are not empty are:
    
            ArrayList arl = new ArrayList();
            if (TextBox1.Text.Trim() != "")
        {
            arl.Add("productid");
        }
            if (TextBox2.Text.Trim() != "")
        {
            arl.Add("sh\_desc");
        }
            if (TextBox3.Text.Trim() != "")
        {
            arl.Add("weight");
        }
            if (TextBox4.Text.Trim() != "")
        {
            arl.Add("length");
        }
            if (TextBox5.Text.Trim() != "")
        {
            arl.Add("width");
        }
            if (TextBox6.Text.Trim() != "")
        {
            arl.Add("height");
        }
    
        //Now take out the items from the arraylist
    
        for (int i = 0; i <= arl.Count; i++ )
        {
            if (arl\[i\].ToString().StartsWith("productid"))
            {
    
            }
        }
        cmd.CommandText = "select sh\_desc,productid,price from PRODUCTS where ";
            
            cmd.Connection.Open();
    
            dt = new DataTable();
            dt.Columns.Add("REF", typeof(string));
            dt.Columns.Add("Description", typeof(string));
            dt.Columns.Add("Price", typeof(float));
            SqlDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                pr\_id = (rdr\["productid"\]).ToString();
                testsh\_desc = (rdr\["sh\_desc"\]).ToString();
                test\_price = Convert.ToSingle(rdr\[
    
    ASP.NET database

  • scripting issue.....
    R RajpootRohan

    Hello friends, The site I am working on, is affected by a malicious script. Actually it is always added at the end of the inline code. If it is a html page, then there will not be problem in opening the page. But if the page is using master page and when it is added at the end on the inline code i.e outside the content tag, then there will be a parser error saying that " Only Content controls are allowed directly in a content page that contains Content controls." Now my question is , Is there any way to block these types of malicious scripts being added in the inline code. I should tell you that I googled a lot and gathered some of the articles from the msdn site showing the security measures to avoid these scripts. I worked accordingly and did all the steps like validating the user input, validating the query string, validate request property in the web.config etc... Also I contacted the server guys. But they are saying that it is coming from the browser i.e they are pointing the arrow towards the coding part. I dont know where I am lacking. Please assist me.

    cheers, sneha

    ASP.NET help html database sysadmin security
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups