Click here to Skip to main content
16,004,969 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: retrieve an image from sql Pin
Abhijit Jana11-Jun-09 21:20
professionalAbhijit Jana11-Jun-09 21:20 
AnswerRe: retrieve an image from sql Pin
Aman Bhullar11-Jun-09 21:39
Aman Bhullar11-Jun-09 21:39 
AnswerRe: retrieve an image from sql Pin
y_mmohd12-Jun-09 1:37
y_mmohd12-Jun-09 1:37 
QuestionGoogle local search with asp.net (read the data returned by google local earch) Pin
rahul.net1111-Jun-09 19:24
rahul.net1111-Jun-09 19:24 
QuestionMouseover briefnews using ajax control Pin
Member 387988111-Jun-09 18:34
Member 387988111-Jun-09 18:34 
Questionscroll through images Pin
toprogramminguy11-Jun-09 15:37
toprogramminguy11-Jun-09 15:37 
AnswerRe: scroll through images Pin
N a v a n e e t h11-Jun-09 15:47
N a v a n e e t h11-Jun-09 15:47 
GeneralRe: scroll through images Pin
toprogramminguy11-Jun-09 16:10
toprogramminguy11-Jun-09 16:10 
If I understand which number you are talking about (the one for the update panel?) I just had it as an int which was set on the page_load event. Then when the button was clicked it incremented the number by 6 and called the getImage function which gets the images form the database. But when the updatepanel is updated it resets the int back to the original number so it just loops...
but what i cant understand is that it increments once but thats itConfused | :confused:
It's probably something dumb but I cant figure it out.Roll eyes | :rolleyes:
like this anyway:
public partial class comicBrowser : System.Web.UI.UserControl
{
    public int currentComics;
    private Panel thumbnails = new Panel();
    private string connectionString;
    protected void Page_Load(object sender, EventArgs e)
    {
        currentComics = 6;
        setConnectionString();
        UpdatePanel1.ContentTemplateContainer.Controls.Add(thumbnails);
        accessDatatables();
    }

    private void setConnectionString()//gets the connection string from the .comfig file
    {
        Configuration Config =
                System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/WebSite");
        ConnectionStringSettings connString;
        if (0 < Config.ConnectionStrings.ConnectionStrings.Count)
        {
            connString =
                Config.ConnectionStrings.ConnectionStrings["data"];
            if (null != connString)
                connectionString = connString.ConnectionString;
        }
    }

    private void accessDatatables()
    {
        SqlConnection conn = new SqlConnection(connectionString);

        SqlDataReader readr = null;

        SqlCommand cmd = null;

        try
        {
            conn.Open();
            cmd = new SqlCommand("SELECT comicUrl, comicId, comicRating, comicName FROM comicDatabase WHERE (comicId <= " + currentComics +
                ") AND (comicId > " + (currentComics - 6) + ")", conn);

            readr = cmd.ExecuteReader();

            while (readr.Read())
            {
                loadMenu(readr.GetString(0), readr.GetInt32(1), readr.GetInt32(2), readr.GetString(3));
            }
        }
        catch(Exception ex)
        {
            this.Page.Title = ex.ToString();
        }
        finally
        {
            if (conn != null)
                conn.Close();

            if (readr != null)
                readr.Dispose();
        }
    }

    private void loadMenu(string comicUrl, int comicId, int comicRating, string comicName)...

    protected void right_Click(object sender, ImageClickEventArgs e)
    {
        currentComics += 6;

        thumbnails.Controls.Clear();//clears previous images

        accessDatatables();//gets and displays the images

        updatejavascript();
    }

    protected void left_Click(object sender, ImageClickEventArgs e)
    {
        currentComics -= 6;

        thumbnails.Controls.Clear();//clears previous images

        accessDatatables();//gets and displays the images

        updatejavascript();
    }
    private void updatejavascript()
    {
        ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "scriptkey", "updateJavascript();", true);
        //calls a javascript function to reload animations for the elements
    }
}


sorry about plonking a heap of it in...
GeneralRe: scroll through images Pin
N a v a n e e t h11-Jun-09 16:21
N a v a n e e t h11-Jun-09 16:21 
GeneralRe: scroll through images Pin
toprogramminguy11-Jun-09 16:42
toprogramminguy11-Jun-09 16:42 
GeneralRe: scroll through images Pin
N a v a n e e t h11-Jun-09 17:11
N a v a n e e t h11-Jun-09 17:11 
GeneralRe: scroll through images Pin
toprogramminguy11-Jun-09 17:21
toprogramminguy11-Jun-09 17:21 
GeneralRe: scroll through images Pin
N a v a n e e t h11-Jun-09 17:31
N a v a n e e t h11-Jun-09 17:31 
GeneralRe: scroll through images Pin
toprogramminguy11-Jun-09 17:41
toprogramminguy11-Jun-09 17:41 
QuestionHelp to Test a web app Pin
AlexeiXX311-Jun-09 14:56
AlexeiXX311-Jun-09 14:56 
QuestionTextbox Focus with ajax timer Pin
Mohammed Elkholy11-Jun-09 8:44
Mohammed Elkholy11-Jun-09 8:44 
AnswerRe: Textbox Focus with ajax timer Pin
Christian Graus11-Jun-09 14:14
protectorChristian Graus11-Jun-09 14:14 
GeneralRe: Textbox Focus with ajax timer Pin
Mohammed Elkholy11-Jun-09 17:09
Mohammed Elkholy11-Jun-09 17:09 
QuestionRe: Textbox Focus with ajax timer Pin
N a v a n e e t h11-Jun-09 17:14
N a v a n e e t h11-Jun-09 17:14 
AnswerRe: Textbox Focus with ajax timer Pin
Mohammed Elkholy12-Jun-09 5:20
Mohammed Elkholy12-Jun-09 5:20 
QuestionHow to buid a forum site in asp.net Pin
Mohammad Rakibul Hasan11-Jun-09 8:08
Mohammad Rakibul Hasan11-Jun-09 8:08 
AnswerRe: How to buid a forum site in asp.net Pin
Abhijit Jana11-Jun-09 8:23
professionalAbhijit Jana11-Jun-09 8:23 
AnswerRe: How to buid a forum site in asp.net Pin
Christian Graus11-Jun-09 14:15
protectorChristian Graus11-Jun-09 14:15 
Questionhow to add tamil or hindi font Pin
anbusenthil11-Jun-09 7:51
anbusenthil11-Jun-09 7:51 
AnswerRe: how to add tamil or hindi font Pin
Abhijit Jana11-Jun-09 8:47
professionalAbhijit Jana11-Jun-09 8:47 

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.