|
Hi,
Thanks for the reply, it wud be very nice if u cud give me a small example of it.Some small piece of code.
Waiting for ur reply.
Thanks,
Riz
Riz
|
|
|
|
|
|
maybe try frame2.document.location.href = 'http://www.codeproject.com';
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
I have a page lists many files that allow user to download. User can choose files by checkbox that just right beside the files name. When a user click Download button, all the choosed files have been zipped to a single zip file and a download prompt winodw shows up immideatly and the user can choose a folder to save the file. The download times for each file has been updated into the database. All above processes have been implemented.
Because inside the download function, I use the following statement.
Response.Flush()
Response.Close()
Response.End()
So even I call my update function to refresh the page, it wouldn't work. However, I think the requirement is really fair. After user download spcific files, the download times update and rendered at the same time.
My question is after the zip file has been saved locally, how to refresh(post) the page to show the download times.
Thanks,
|
|
|
|
|
IMO, you can open a new web page which is reponsible for downloading the file, and you can refresh the main page in the normal way.
|
|
|
|
|
i have a page wherein an iframe is in it.. the page simply zooms the image in the iframe.. the zoom out and zoom in is outside the iframe.. how can i access the image in the iframe??
this is the main page
Public Class pgViewImage<br />
Inherits System.Web.UI.Page<br />
<br />
Private msLoc As String = "C:\Inetpub\wwwroot\MetSysClient\Images\"<br />
Private sImageName As String = "car"<br />
<br />
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'Put user code to initialize the page here<br />
<br />
Dim ShowImage As HtmlControl = CType(Me.FindControl("ShowImage"), HtmlControl)<br />
Dim btnMainImage As WebControl = CType(ShowImage.FindControl("btnMainImage"), WebControl)<br />
<br />
If Not IsPostBack Then<br />
<br />
'On the first page load, we need to know <br />
'the original image's size and get the <br />
'center x and y coordinates<br />
<br />
Dim i As System.Drawing.Image = _<br />
System.Drawing.Image.FromFile(msLoc & sImageName & ".jpg")<br />
ImageWidth = i.Width<br />
ImageHeight = i.Height<br />
X = CInt(ImageWidth / 2)<br />
Y = CInt(ImageHeight / 2)<br />
Z = 1<br />
i.Dispose()<br />
getimage()<br />
<br />
End If<br />
<br />
End Sub<br />
<br />
Private Sub btnMainImage_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
If Z = 1 Then<br />
X = e.X<br />
Y = e.Y<br />
Z = 2<br />
Else<br />
X = CInt(hx.Value) - CInt((CInt(ImageWidth / 2) - e.X) / Z)<br />
Y = CInt(hy.Value) - CInt((CInt(ImageHeight / 2) - e.Y) / Z)<br />
End If<br />
getimage()<br />
End Sub<br />
<br />
Private Sub btnLeft_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
X = X - 20<br />
getimage()<br />
End Sub<br />
<br />
Private Sub btnRight_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
X = X + 20<br />
getimage()<br />
End Sub<br />
<br />
Private Sub btnUp_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
Y = Y - 20<br />
getimage()<br />
End Sub<br />
<br />
Private Sub btnDown_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
Y = Y + 20<br />
getimage()<br />
End Sub<br />
<br />
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)<br />
X = CInt(ImageWidth / 2)<br />
Y = CInt(ImageHeight / 2)<br />
Z = 1<br />
getimage()<br />
End Sub<br />
<br />
Private Sub cmdZoomIn_Click(ByVal sender As System.Object, ByVal e As _<br />
System.EventArgs) Handles cmdZoomIn.Click<br />
If Z < 8 Then<br />
Z = Z * 2<br />
End If<br />
<br />
getimage()<br />
End Sub<br />
<br />
Private Sub cmdZoomOut_Click(ByVal sender As System.Object, ByVal e As _<br />
System.EventArgs) Handles cmdZoomOut.Click<br />
If Z > 1 Then<br />
Z = CInt(Z / 2)<br />
End If<br />
getimage()<br />
End Sub<br />
<br />
Public Sub getimage()<br />
Dim srcx, srcy As Integer<br />
<br />
<br />
'Convert X Value to Top Left of image<br />
srcx = X - CInt(CInt(ImageWidth / 2) / Z)<br />
If srcx < 0 Then srcx = 0<br />
If srcx > ImageWidth Then srcx = ImageWidth<br />
<br />
'Convert Y value to Top Left of Image<br />
srcy = Y - CInt(CInt(ImageHeight / 2) / Z)<br />
If srcy < 0 Then srcy = 0<br />
If srcy > ImageHeight Then srcy = ImageHeight<br />
<br />
'Set the source of the Image to be our Processing aspx page<br />
<br />
'btnMainImage.ImageUrl = "pgZoomProcessor.aspx?x=" & srcx & _<br />
'"&y=" & srcy & "&z=" & Z & "&img=" & sImageName<br />
<br />
hx.Value = X.ToString<br />
hy.Value = Y.ToString<br />
<br />
'Enable/disable buttons<br />
<br />
<br />
If Z = 8 Then<br />
cmdZoomIn.Enabled = False<br />
Else<br />
cmdZoomIn.Enabled = True<br />
End If<br />
<br />
End Sub<br />
<br />
Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _<br />
Handles cmdClose.Click<br />
Dim script(1) As String<br />
<br />
script(1) = "<script> self.close() </script>"<br />
RegisterClientScriptBlock("test", Join(script, ""))<br />
<br />
End Sub<br />
<br />
<br />
End Class<br />
<br />
this is the page that the iframe calls:
<br />
Public Class pgImage<br />
Inherits System.Web.UI.Page<br />
<br />
Private msLoc As String = "C:\Inetpub\wwwroot\MetSysClient\Images\"<br />
Private sImageName As String = "biglogo"<br />
<br />
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'Put user code to initialize the page here<br />
<br />
If Not IsPostBack Then<br />
<br />
'On the first page load, we need to know <br />
'the original image's size and get the <br />
'center x and y coordinates<br />
Dim i As System.Drawing.Image = _<br />
System.Drawing.Image.FromFile(msLoc & sImageName & ".jpg")<br />
ImageWidth = i.Width<br />
ImageHeight = i.Height<br />
X = CInt(ImageWidth / 2)<br />
Y = CInt(ImageHeight / 2)<br />
Z = 1<br />
i.Dispose()<br />
getimage()<br />
<br />
End If<br />
End Sub<br />
<br />
Private Sub btnMainImage_Click(ByVal sender As System.Object, ByVal e As _<br />
System.Web.UI.ImageClickEventArgs) Handles btnMainImage.Click<br />
If Z = 1 Then<br />
X = e.X<br />
Y = e.Y<br />
Z = 2<br />
Else<br />
X = CInt(hx.Value) - CInt((CInt(ImageWidth / 2) - e.X) / Z)<br />
Y = CInt(hy.Value) - CInt((CInt(ImageHeight / 2) - e.Y) / Z)<br />
End If<br />
getimage()<br />
End Sub<br />
<br />
Public Sub getimage()<br />
Dim srcx, srcy As Integer<br />
<br />
'Convert X Value to Top Left of image<br />
srcx = X - CInt(CInt(ImageWidth / 2) / Z)<br />
If srcx < 0 Then srcx = 0<br />
If srcx > ImageWidth Then srcx = ImageWidth<br />
<br />
'Convert Y value to Top Left of Image<br />
srcy = Y - CInt(CInt(ImageHeight / 2) / Z)<br />
If srcy < 0 Then srcy = 0<br />
If srcy > ImageHeight Then srcy = ImageHeight<br />
<br />
'Set the source of the Image to be our Processing aspx page<br />
<br />
btnMainImage.ImageUrl = "pgZoomProcessor.aspx?x=" & srcx & _<br />
"&y=" & srcy & "&z=" & Z & "&img=" & sImageName<br />
hx.Value = X.ToString<br />
hy.Value = Y.ToString<br />
<br />
'Enable/disable buttons<br />
<br />
'If Z = 8 Then<br />
' cmdZoomIn.Enabled = False<br />
'Else<br />
' cmdZoomIn.Enabled = True<br />
'End If<br />
<br />
End Sub<br />
<br />
Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />
Dim script(1) As String<br />
<br />
script(1) = "<script> self.close() </script>"<br />
RegisterClientScriptBlock("test", Join(script, ""))<br />
<br />
End Sub<br />
End Class<br />
this is the page for the processing of the image:
<br />
Public Class pgZoomProcessor<br />
Inherits System.Web.UI.Page<br />
<br />
Private msLoc As String = "C:\Inetpub\wwwroot\MetSysClient\Images\"<br />
<br />
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As _<br />
System.EventArgs) Handles MyBase.Load<br />
<br />
'Create a new Image object from our source image<br />
Dim i As System.Drawing.Image = _<br />
System.Drawing.Image.FromFile(msLoc & Request("img") & ".jpg")<br />
<br />
'System.Drawing.Image.FromFile(Server.MapPath("./" _<br />
'& Request("img") & ".jpg"))<br />
<br />
<br />
'Create a workable bitmap image<br />
Dim b As New System.Drawing.Bitmap(CInt(i.Width), _<br />
CInt(i.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb)<br />
<br />
'Place the bitmap image in a Graphics object<br />
Dim g As Graphics = Graphics.FromImage(b)<br />
<br />
'Set the default image background color <br />
g.Clear(Color.White)<br />
<br />
'Crop the main image<br />
'Get Coordinates and Zoom Values from querystring<br />
Dim x As Integer = CInt(Request("X"))<br />
Dim Y As Integer = CInt(Request("y"))<br />
Dim Z As Integer = CInt(Request("z"))<br />
'Create 2 rectangles. We can grab a rectangle portion<br />
'of the original image and stretch it to fit the size<br />
'of the larger rectangle.<br />
Dim src As New Rectangle<br />
Dim dst As New Rectangle<br />
<br />
'Set Source rectangle properties<br />
src.X = x<br />
src.Y = Y<br />
src.Width = CInt(i.Width / Z)<br />
src.Height = CInt(i.Height / Z)<br />
<br />
'Set Destination rectangle properties<br />
dst.X = 0<br />
dst.Y = 0<br />
dst.Width = CInt(i.Width)<br />
dst.Height = CInt(i.Height)<br />
<br />
'Create the image from our rectangles<br />
g.DrawImage(i, dst, src, GraphicsUnit.Pixel)<br />
<br />
'Set the content type <br />
Response.ContentType = "image/jpeg"<br />
<br />
'Save the image as the Output of this page <br />
b.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)<br />
<br />
'Clean Up<br />
src = Nothing<br />
dst = Nothing<br />
g = Nothing<br />
b = Nothing<br />
i = Nothing<br />
End Sub<br />
<br />
End Class<br />
<br />
anyone know how to solve this?
thanks...
|
|
|
|
|
the frame is inside your dom
var myframe = document.getElementById('framenamehere');
then using the DOM do your stuff
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi , please i bound a gridview with a datatable & we can say from the data side everything is alright but i have a small problem here , is just when i get the records or the rows in the gridview , supposing i have a field in that row this field contain a string(20) , but in the gridview i have just the wigth that can take (12) characters , did you got it ? i hope so
i want to do a autosize to that field & to all the grid like that i can see all the informations within the grid
thank you
-- modified at 5:22 Thursday 27th July, 2006
|
|
|
|
|
Hi Everyone,
I just downloaded an Eval version of Dundas Charting tools and it comes with these Demo projects, however when I try to run the demo projects, for every single one I get this basic error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'sales.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="sales.Global" %>
I tried Building it to fix it and then running it but that did not work for any of them. Please help. Thanks
Sincerely,
The Major Rager
|
|
|
|
|
There are a couple of things that you might want to check:
+ The version of the ASP.NET that your demo application runs under.
+ Do you really create the application for the demo in IIS? or it's just a sub folder of another web application?
+ Make sure the assembly contains the sales.Global type should appear in the bin folder.
Also, IMHO the Dundas support team may give you better help to get you quickly started with the product.
|
|
|
|
|
Hi All,
Little help needed.
I have a datagrid, and I want a functionality for color change of row when "onclick" event occur.
I am able to change the color of the row when "onclick" event occur.
e.item.attribute.add("onclick","this.style.backgroundColor='red'")
But, When I click on another row, I want to deselect the previously selected row.
I tried some code with javascript, but no luck yet.
Any help will be highly appreciated.
Thank you very much,
Robin
|
|
|
|
|
|
no, i am not using property builder. bz i need to pass values of selected datagrid row to client side java script function in order to avoid second server trip.
Thanks
|
|
|
|
|
Hi there,
IMO, you can use an hidden box to store the lastest row id selected by user
So whenever an row is clicked, you just set the the row who has the same id as the id stored in the hidden box to the original color...
Hope you get the idea..
<< >>
|
|
|
|
|
Has anyone used custom classes to tie to the GridView, FormView, or DetailsView?
I heard theres a lot of events that have to be implemented. Would you have a link that explains each event that should be implmeneted?
Please no answers telling me to use ADO.NET or anything related to ADO.NET.
I am looking for examples of custom classes not inheriting any classes related to ADO.NET. <-- as you can tell I don't like to use it
If you know the answer or links I would greatly appreciate it.
Thanks,
Nick
And to re-iterate. If you don't know or understand how, please dont answer. I am looking for answers that understands what I am talking about. And if you think your way is better by using ADO.NET please keep it to yourself. Datasets are bulky and will not accomplish what is needed effeciently in a DAL situation. I don't feel like getting into another argument with anyone else.
-- modified at 16:36 Wednesday 26th July, 2006
|
|
|
|
|
Why use ADO.Net when you can over complicate things and write your own classes? I love making things harder then they need to be.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Actually sorry for being rude. But, telling me to not use classes to represent data make no sense. And I said to please not give me answers related to ADO.NET.
Im interested in a more advanced and true oop representation of data that you are not used to.
And I can make my classes using generics just as fast as you can. Maybe even faster using Generics.
So please read the question next time.
Nick
-- modified at 15:55 Wednesday 26th July, 2006
|
|
|
|
|
You can use Typed Datasets (as a DAL) then make a classes for business logic that your presentation layer will actually talk to. With the right attributes you can make it so you can set methods as datasources for GridViews and the such. Here are some good overviews:
and
|
|
|
|
|
Well it ate the anchor tags... thats odd.
http://msdn.microsoft.com/asp.net/reference/data/default.aspx?pull=/library/en-us/dnaspnettut/html/aspnet_tutorial01_dataaccesslayer_cs.asp
http://msdn.microsoft.com/asp.net/reference/data/default.aspx?pull=/library/en-us/dnaspnettut/html/aspnet_tutorial02_businesslogiclayer_cs.asp
|
|
|
|
|
thats ok DataSets suck
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Angry person, aren't you...
Have you had a look at the object data source in .net 2.0? As far as i know, any class that implements IEnumerable can be bound to a .net control like a gridview - it's very simple.
|
|
|
|
|
Actually. I was just annoyed that people who dont know what thier talking about give me answers that are wrong anyways. And it had nothing to do with the question.
But, for the Views(gridview, formview, and detailview) Dino Esposito briefly mentioned in one of his books that you have to extend more than the IEnumerable interfaces. That only works with the data grid.
I just need a list of the interfaces it requires
Thanks,
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
It works with Gridview. Might i suggest maybe trying it?
|
|
|
|
|
Actually you have to use the IDataBinding interface to get the full capabilities
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi,
I just finished my ASPNET web application. It is a e-commerce based application developed using ASPNET and Microsoft SQL server. I am finding lot of issues with the performance.
How can I improve the performance of my application. Where are the possibilities to improve the application speed.
Thanks
-Sudhakar
|
|
|
|