|
hey man i tried with .controls(0) & it doesn't work
but with .controls(1) it worked what mean that (1) ? & what is a literalcontrol ?
an other thing !! in the 'your code part i want to write something to select that row but i didn't find a select methode or somthing , when i did row.selectedindex = intindex it doesn't work !!
any idea ?
-- modified at 6:11 Thursday 27th July, 2006
|
|
|
|
|
Hi ,
I have created a page which basically parses a xml file and populates the page accordingly .Now
the problem is inorder to provide more flexibiliy i need to allow any page to inherit this base page,but on inheriting the class and executing it the base page controls are not visible.I undestand it cant be done by that way.Then pls suggest a solution.I doubt the same can be done with master page.
Thanks in advance,
|
|
|
|
|
Master Page would be your choice.
|
|
|
|
|
hi
how to create a cs Class for XSD.
kamalnath
|
|
|
|
|
|
I have two drop down in a datagrid.What i want when i select an item from the first the second one should be populated accordingly.My problem is i have created an event handler for the first drop down but how do i call the second drop down to populate
|
|
|
|
|
You can call a function on OnSelectedIndexChanged event of the dropdownlist and in that event you can populate another dropdownlist. Are you getting any problem in this?
Best Regards,
Apurva Kaushal
|
|
|
|
|
how do i cal the second drop down that is the problem .How do i identify the control which is inside a datagrid
|
|
|
|
|
You have to iterate through all the items of the datagrid and then you can find the other dropdown list(findcontrol method) and populate that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi friends,
How to pass the space (" ") in Request.QueryString in ASP.NET.
In my Application i am passing the path of the folder through Querystring. But if the name of the folder consists two words inbetween space it gets only the first word and check for that folder and says Directory Not Found Exception.
Please Help.
Thanks & Regards
Prya
|
|
|
|
|
|
the other issue you might run across is illigal characters in that file.
Since its a small item you'd be better off store that is a session or cache
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi, I have a asp .net application. In the application I attempt to start a thread from globals "Application_start" method. My problem is that the start page never fully loads and the secondary thread fails on a specific line but it gives me no indication as to which one. Thus I get the message "Server Unavailable". Is this a case of deadlock? or do you need to apply threads differently in asp .net.
cheers
Mike
|
|
|
|
|
Well, I'm not sure of the specific problem, but here are a couple of links to some excellent articles on threading in ASP.NET. Perhaps you've already read them, but if not, they're good reads:
http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/
http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/
You might consider turning on tracing just calling the failing code synchronously until you can determine which line is causing the error.
|
|
|
|
|
Hi all,
greetings.In my application i've to bound data with a dropdown list with our any data source control.That by coding i've to bound.Here i'm using C#.Can anyone tell me the coding for the binding of data with DDL.
Thanks in Advance
Babu
|
|
|
|
|
This sort of questions can be quickly answered by MSDN:
DropDownList[^]
|
|
|
|
|
Hi,
I have two frames, Frame1 and Frame2.I have some buttons in Frame1 and on click of those buttons i want a new page to be displayed in the Frame2.
On the button click, i am using Response.Redirect("abc.aspx") but the page gets opened in the Frame1 itself and not on Frame2.Please tell me how to specify the target using Response.Redirect.So that on any button click present in Frame1, the page gets opened in Frame2.
It's very urgent.
Thanks,
Riz
Riz
|
|
|
|
|
Response.Redirect method cannot help in this case as it redirects the new page in the current frame. You need to use javascript to get reference to the second frame and load the new page with the src attribute, google can quickly find you the sample script.
|
|
|
|
|
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
|
|
|
|