|
y_mmohd wrote: When I retrieve an image from sql database in the grid view I had the following (System.Byte[]) instead the image.
Where are you getting the error? Is there any thing problem with byte conversion ?
Have a look into this article, This is another way to show image from database to gridview. Displaying Image in Gridview from Database
Here you have to store image path in the database rather than the image. Image will store in your hard drive.
|
|
|
|
|
Check out Links
http://www.odetocode.com/Articles/172.aspx[^]
http://aspalliance.com/140[^]
|
|
|
|
|
Thanks you for being Helpful,
I need your advice I want to create a web site for shopping online. The customers can upload their images to the web.
What is the best solution for this:
1- To store the image inside the table in the sql server.
2- Or to store the images inside a folder in the web.
|
|
|
|
|
Hi all,
I want to use google local search in my website. I have displayed google
local serach using the javascript API. Google has provided a search control
we just need to set some properties,send the sesarch query and google return
result a control on a page. When we use google local search Javascript API
a search textbox a button is displayed on web site. I dont want to use that button
i want to use button and textbox which is already in my website.
Second thing is that when google return the result i want to read the
result because i want to insert the data in database when user click on a button beside
the search result. How can i read the result returned by google.
Please help me to solve this?
Ex : url maps.google.com
open the above url and enter newyork,pune india and hit search button it
will retun some set of result and i want to read all the data.
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi to all in my grid i bind my short news...,
In my mouseover event i want of the short news i need the brief news in modal popup/ anyother way...,
what i need is exactly like this :
plz look at this link "Top Business feeds from across the web" section
http://www.in.com/news/business-news.html
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Ok so I have a database of images, a certain amount of which i want to display on a webpage at a time.
The way it is working at the moment is each time the "next" button is clicked, it uses Response.Redirect() and supplies a query string to select the next 6 images to display them. This works ok but each time the whole page has to load so I would prefer if i could use an updatepanel.
I have tried this and instead of supplying a query string the button click event increments the number of selection of images to be displayed.
However, when the updatepanel updates the previous number is lost and does not increment because it is set back at 0.
Is there any other way to do this without loading the whole page each time.
Sorry if I've explained it badly...
if you need more info I can post the code...
thanks
|
|
|
|
|
How are you tracking the previous number?
|
|
|
|
|
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 it
It's probably something dumb but I cant figure it out.
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()
{
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();
accessDatatables();
updatejavascript();
}
protected void left_Click(object sender, ImageClickEventArgs e)
{
currentComics -= 6;
thumbnails.Controls.Clear();
accessDatatables();
updatejavascript();
}
private void updatejavascript()
{
ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "scriptkey", "updateJavascript();", true);
}
}
sorry about plonking a heap of it in...
|
|
|
|
|
toprogramminguy wrote: protected void Page_Load(object sender, EventArgs e)
{
currentComics = 6;
setConnectionString();
UpdatePanel1.ContentTemplateContainer.Controls.Add(thumbnails);
accessDatatables();
}
There is the problem. Update panel doesn't refresh the page, but it does a postback and your page load will execute all the time. So guard the page load code with !IsPostBack check. Also the currentComics variable is a class level variable and it's value will be reset each time. So you need to persist the value may be using viewstate or other persisting mechanisms.
|
|
|
|
|
Ok now I've added this:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
currentComics = 6;
setConnectionString();
UpdatePanel1.ContentTemplateContainer.Controls.Add(thumbnails);
accessDatatables();
}
else currentComics = (int)ViewState["currentcomics"];
}
and this:
protected void right_Click(object sender, ImageClickEventArgs e)
{
currentComics += 6;
ViewState["currentcomics"] = currentComics;
thumbnails.Controls.Clear();
accessDatatables();
updatejavascript();
}
but when it gets to here(in the first code block):
else currentComics = (int)ViewState["currentcomics"];
then it says: Object reference not set to an instance of an object.
Am i using the viewstate wrong?
|
|
|
|
|
toprogramminguy wrote: Am i using the viewstate wrong?
page_load executes first before executing the button click handler. So first time ViewState["currentcomics"] will have NULL value. So do a NULL check before you access the value. Something like..
else currentComics = ViewState["currentcomics"] == null ? 6 : (int)ViewState["currentcomics"];
|
|
|
|
|
Ya i have done that now, but it wasnt on the first run that the exception was thrown because it wouldnt have been a postback , it was when I clicked the next button which has me all confused again
does the accessDatatables(); get called when i call it in the buttonclick event handler or when the updatepanel is reloaded?
|
|
|
|
|
toprogramminguy wrote: but it wasnt on the first run that the exception was thrown
Yes. It will be thrown when you clock the next button for the first time. Your else portion will get executed, but since ViewState is not created for the key you are accessing, it will return NULL.
toprogramminguy wrote: does the accessDatatables(); get called when i call it in the buttonclick event handler or when the updatepanel is reloaded?
I am not getting what you mean here. It will be called when the next button is clicked.
|
|
|
|
|
Ok. Now the button is incrementing the currentcomic value but when the updatecontrol reloads nothing is displayed event though the updateprogress is showing so I know something is happening.
Thanks for your help.
I'll figure out the rest of it myself...hopefully
|
|
|
|
|
Hi, thanks for looking, i had posted this link in the testing forum, but that forum is kind of "lonely"
I made a web app: PideEnLinea.com[^]
Im not sure how secure it is, i did follow some security guidelines, but who knows
Also i made some load tests
If someone has a chance, please visit it and try to make some sql injections, XSS or try to hack it
If you do hack it or make sql injections or XSS, please let me know by replying here :P
Thanks in advance for any feedback
Alexei Rodriguez
|
|
|
|
|
Dear all
i have a page included ajax timer
and textbxo while i focus and write in textbox i lose the focue when the time ticke work
and i should set the textbox focus to continue writting and i lose it again when the timer work
i need help for this i want finish writting in textbox while the timer working
thanks for help
MD_NADA
|
|
|
|
|
Hard to comment without seeing code, but I would suspect that you perhaps want to reset your timer while the textbox has focus ? What does the timer do ? It sounds like it moves the focus to some other control.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
i am sorry i didn't descrip my case well
but my homepage has many usercontrol
some of these controls included ajax timer and in my home page i have 1 control for search and one control
for login
if i write in search textbox it is easy until the timer ticker work
i lose the focus of textbox and i cant continue write in textbox and the samler to login textbox
i hope i descrip it well
MD_NADA
|
|
|
|
|
Still you haven't answered the question - What does timer do? Is it setting focus to some other control?
|
|
|
|
|
the timer used for displaying the news i change the news title and news image in the timer ticke
so when the news change i lose the focus of textbox
MD_NADA
|
|
|
|
|
Hi, guys. Can any one help me to build a forum site in asp.net.
I want to build it from scratch.
|
|
|
|
|
Mohammad Rakibul Hasan wrote: Hi, guys. Can any one help me to build a forum site in asp.net.
I want to build it from scratch.
Collect requirmetns, Prepared Design Doc, Techincal Desing, Start Development.. if stuck ask CP, Test the application, Deploy on server... Release it.
Just kidding,
Look Here
|
|
|
|
|
Well, if that's all you know about how to do it, then you should start by reading an ASP.NET book. This site works best when people do some work themselves, then ask specific questions as they get stuck.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
how to add tamil or hindi font
into asp net
using resource file
|
|
|
|
|