|
can you paste the code that is redirecting the page and displaying alert
|
|
|
|
|
You should use javascript,fire function name from your control.
function ShowAlert()
{
alert('You will redirect in another page');
window.open(' yoururladdress/pagename.aspx');
}
onclick="ShowAlert()"
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
This is wat i used but the page is redirected without waiting for alert box.
|
|
|
|
|
Which control you are using to redirect in another page?
If you are using button then use property
OnClientClick="ShowAlert(); return false;"
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I have validation one the control.Now validation is not working..
|
|
|
|
|
Your core problem is that you think we're mind readers. Your code is broken. We can't fix it without seeing it.
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
|
|
|
|
|
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}
I called it at the server side as
Page.RegisterStartupScript("Error", "<script>changed()</script>");
Response.Redirect("UserProfile.aspx");
inside the click event of the button.That button will cause validation also.
My problem is the page is redirected before alert is clicked.
|
|
|
|
|
According to me, the code should redirect to Default.aspx not UserProfile.aspx.
In server side code, you register the client script block and then you redirected it to Default.aspx. You comment the Response.Redirect, it will start redirecting to UserProfile Page
|
|
|
|
|
Yes, that's always going to be the case - why don't you put your redirection into the javascript function as well...
|
|
|
|
|
anu_anu wrote: Page.RegisterStartupScript("Error", "changed()");
This injects script into the page.
anu_anu wrote: Response.Redirect("UserProfile.aspx");
This redirects, so that your page is never rendered.
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
|
|
|
|
|
Post the code which you are using. Code shared by Blue Boy should definitely work.
There is no foolish question, there is no final answer...
|
|
|
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ci As CultureInfo
If Not Page.IsPostBack Then
'Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))--------------> error here
"Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified."
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
End Sub
|
|
|
|
|
What makes you think that an assembly of that name exists ?
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
|
|
|
|
|
|
When I retrieve an image from sql database in the grid view I had the following (System.Byte[]) instead the image. What is the problem?
Thank you
|
|
|
|
|
You are not displaying images correctly.
Check this link[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
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...
|
|
|
|