Click here to Skip to main content
15,894,405 members
Home / Discussions / C#
   

C#

 
GeneralChanging value in variable from another called class Pin
StealthRT28-Mar-21 17:26
StealthRT28-Mar-21 17:26 
GeneralRe: Changing value in variable from another called class Pin
Richard Deeming28-Mar-21 22:15
mveRichard Deeming28-Mar-21 22:15 
QuestionHow to detect user email address when user clicks on a link sent to their email? Pin
Zeyad Jalil28-Mar-21 1:44
professionalZeyad Jalil28-Mar-21 1:44 
AnswerRe: How to detect user email address when user clicks on a link sent to their email? Pin
Dave Kreskowiak28-Mar-21 8:20
mveDave Kreskowiak28-Mar-21 8:20 
AnswerRe: How to detect user email address when user clicks on a link sent to their email? Pin
OriginalGriff28-Mar-21 9:59
mveOriginalGriff28-Mar-21 9:59 
AnswerRe: How to detect user email address when user clicks on a link sent to their email? Pin
Richard Deeming28-Mar-21 22:04
mveRichard Deeming28-Mar-21 22:04 
QuestionHow to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
Alex Dunlop25-Mar-21 2:43
Alex Dunlop25-Mar-21 2:43 
AnswerRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
OriginalGriff25-Mar-21 5:03
mveOriginalGriff25-Mar-21 5:03 
GeneralRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
Gerry Schmitz25-Mar-21 7:42
mveGerry Schmitz25-Mar-21 7:42 
GeneralRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
OriginalGriff25-Mar-21 11:09
mveOriginalGriff25-Mar-21 11:09 
AnswerRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
Gerry Schmitz25-Mar-21 7:40
mveGerry Schmitz25-Mar-21 7:40 
QuestionChecking for existing open forms Pin
Alex Dunlop24-Mar-21 23:26
Alex Dunlop24-Mar-21 23:26 
AnswerRe: Checking for existing open forms Pin
OriginalGriff24-Mar-21 23:38
mveOriginalGriff24-Mar-21 23:38 
GeneralRe: Checking for existing open forms Pin
Alex Dunlop25-Mar-21 0:08
Alex Dunlop25-Mar-21 0:08 
GeneralRe: Checking for existing open forms Pin
OriginalGriff25-Mar-21 0:37
mveOriginalGriff25-Mar-21 0:37 
AnswerRe: Checking for existing open forms Pin
Richard Deeming25-Mar-21 2:51
mveRichard Deeming25-Mar-21 2:51 
QuestionCopy a selected gridview row to the same gridview Pin
Member 1493285423-Mar-21 2:41
Member 1493285423-Mar-21 2:41 
AnswerRe: Copy a selected gridview row to the same gridview Pin
Gerry Schmitz23-Mar-21 7:08
mveGerry Schmitz23-Mar-21 7:08 
GeneralRe: Copy a selected gridview row to the same gridview Pin
Nathan Minier24-Mar-21 1:20
professionalNathan Minier24-Mar-21 1:20 
GeneralRe: Copy a selected gridview row to the same gridview Pin
jsc4224-Mar-21 1:25
professionaljsc4224-Mar-21 1:25 
GeneralRe: Copy a selected gridview row to the same gridview Pin
Nathan Minier24-Mar-21 1:38
professionalNathan Minier24-Mar-21 1:38 
GeneralRe: Copy a selected gridview row to the same gridview Pin
jsc4225-Mar-21 3:54
professionaljsc4225-Mar-21 3:54 
QuestionHow to able to have the information of the particular image button clicked? Pin
Member 1508474922-Mar-21 10:50
Member 1508474922-Mar-21 10:50 
I am creating a book site for that, I have created dynamic buttons so that if on a particular category is clicked then that row will be fetched from the database and required information will be displayed. Now I want that if the user clicks on any particular book then the data of that book should be displayed in another panel and the current panel should hide.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.UI.HtmlControls;

namespace WebApplication1
{

<pre>
public partial class Genre : System.Web.UI.Page
{

    private int num;
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);<br />
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = "Romance";
        Panel2.Visible = false;

        con.Open();
        String SQL = "Select * from Book_List where Book_category='" + Label1.Text + "'";
        SqlDataAdapter da = new SqlDataAdapter(SQL, con);
        DataSet ds = new DataSet();
        DataTable dt = new DataTable();
        da.Fill(ds);
        num = ds.Tables[0].Rows.Count;
        HtmlGenericControl Book = new HtmlGenericControl("div");
        Book.Attributes.Add("class", "books");
        Panel1.Controls.Add(Book);

        for (int i = 1; i < num; i++)
        {
            HtmlGenericControl myDiv = new HtmlGenericControl("div");
            myDiv.Attributes.Add("class", "myDiv");
            ImageButton image = new ImageButton();
            image.ImageUrl = ds.Tables[0].Rows[i]["Book_image"].ToString();
            image.CssClass = "Img";
            image.Click += new ImageClickEventHandler(this.image_Click);
            HtmlGenericControl content = new HtmlGenericControl("div");
            content.Attributes.Add("class", "content");
            Label name = new Label();
            name.CssClass = "name";
            name.Text = ds.Tables[0].Rows[i]["Book_name"].ToString();
            Label cost = new Label();
            cost.CssClass = "cost";
            cost.Text = "<br/> Rs " + ds.Tables[0].Rows[i]["Book_cost"].ToString();
            Button wishlist = new Button();
            wishlist.CssClass = "wishlist";
            wishlist.Text = "ADD TO WISHLIST";
            Book.Controls.Add(myDiv);
            myDiv.Controls.Add(image);
            myDiv.Controls.Add(content);
            content.Controls.Add(name);
            content.Controls.Add(cost);
            content.Controls.Add(wishlist);

        }

    }
    protected void image_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton image = sender as ImageButton;
        Panel2.Visible = true;
        Panel1.Visible = false;            
    }
   </pre>

AnswerRe: How to able to have the information of the particular image button clicked? Pin
OriginalGriff22-Mar-21 11:18
mveOriginalGriff22-Mar-21 11:18 
GeneralRe: How to able to have the information of the particular image button clicked? Pin
Richard Deeming22-Mar-21 22:25
mveRichard Deeming22-Mar-21 22:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.