|
Hi,
just debug it using Visual Studio or IE developer tool.
|
|
|
|
|
I have few issues.
I checekd it and found that it is calling to JAvascript methid, but the problem is that that UpdatePanel does not show the complete HTML. It hides most of the stuff. So how to deal with that.
|
|
|
|
|
I am tasked with discovering a way to programmatically (with HTML and Javascript) interact with an Adobe PDF file and potentially calling JavaScript within the PDF in an Adobe Reader control. I need to find specific documentation either stating the complete how's, in's and out's or an Adobe publication stating that it cannot be done. Unfortunately, the specific keywords involved make Google searching difficult and I have not found Adobe's site particularly helpful. Also, to make this even more interesting, this needs to be done without Reader Extensions so hacking it to use Web Service listeners and callbacks is out, AIR is out, and Flex is out.
|
|
|
|
|
I want to create a HTML page using XML and XSLT but I need to collect an image from the XML file (embedded) and translate it to the XSLT page for include it in the page, any suggestion about how to do it ?
Best Regards
|
|
|
|
|
XSLT is used to have output based on data passed through xml. If you want to show an image, either place the url of the image embedded within the xml or create image in the server and modify xml with appropriate path.
You might also consider to directly write the base64 stream in source of img tag, but it doesnt work in most of the browser nowadays.
<img src="data:image/gif;base64,DASD234AFD+" />
|
|
|
|
|
I dont explain it enough, I have just the image embedded in the XML document, but now I am processing the XML document containing the image with an XSLT stylesheet for creating an HTML page and I want that this page shows the image, so I know that I need:
1) Recover the image from the XML (with binary reader).
2) recover the image in memory (not problem a memoryStream and a BitMap object)
3) send the content of the bitmap to the XSLT stylesheet for include in the HTML page ( this I dont know How).
Best Regards
|
|
|
|
|
Yes.. I got your point.
First of all, XSLT is processed in browser. You just do the logic how the html will be generated and pass the XML. There is no option to generate an image in the browser in XSLT.
If you are going to use embedded image in xml, you need to either transform them in server side to produce image and replace the image path in xml and generate html from that xml... or embed the base64 directly in img src as I mentioned.
I think the first option is good, you need to store the embedded data with image source in the xml before you add xml transformation.
If I was in your situation, I would have used Repeater directly, rather than depend so much in browser using XSLT. Repeater is always better to handle your html as you are sure what you are generating from the server side. You can use OnItemDataBound event to store the image (or directly put in response) and add it to src.
Anyways, you should better choose what suits you. But somehow you have to change the embedded base64 stream to proper image data.
|
|
|
|
|
Really Abhishek, No option to recover the image at client level, so I know that I need to use an binary Reader to recover the Image from the XML file, and store the data in a Stream, later I have two options, save the data to a file using a FileStream, but it's not a good option to save data in client hard disk, so there is also one option of creating a Bitmap object in memory because this object, accepts a stream as data origen, but later I don´t know how to point to the bitmap from the xls, because the image src parameter allways look for a string and not any other object.
I think that this functionality must be very frecuent in News Web Pages which receive a XML with data and Photo and inmediately process them, you told me about an repeater object, I'm going to analyze such possibility.
Best Regards
|
|
|
|
|
Yes...
Another thing that I need to address, images are actually called as a new Request. So for every image request, IIS will spawn a new thread from its ThreadPool and create a Response.
If you can, you can just put the image data into the database or some storage and pass the id to the xml. Create one HttpHandler which will request the image with the id. Say your httphandler is ImageResource.axd .
you write using xslt as :
<img src="ImageResource.axd?id=59" /><br />
Now within the ProcessRequest , write the image data directly in the response stream.
This might be one useful way.
Also it is impossible to store image directly to client hard disk because of security issue in browser. What you can do, is place some Cache headers to the response, and the browser will automatically cache the image to its local storage and will not call the server again if the same resource is called for again.
Cheers.
|
|
|
|
|
Hi ,
On my ascx I have following
<asp:panel runat="server">
In this section...
<asp:label id="Label6" runat="server" text="Label">
<asp:label id="Label7" runat="server" text=" Label">
<asp:label id="Label8" runat="server" text=" Label">
.....
now if I try to access these label controls in my codebehind it says Label doesn't exist in the current context.
I checked the designer file and I even see it in designer file :-
protected global::System.Web.UI.WebControls.Label Label6;
|
|
|
|
|
Restart your visual studio!
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Where is these Labels ?
If it is within the ascx, and you are trying to access it from codebehind of the page where you have added this ascx control, then you would not find the controls directly.
You need to expose them using a property and then use that to set it.
|
|
|
|
|
Thanks..
I restarted my VS twice, yes twice.. !! as the first time it still had same problem.
and then went home for the day. It's working today when I restarted.. grrrrrrrr....
Many Thanks to all.
|
|
|
|
|
Hi All,
I am a newbie to ASP.NET and in need of you help, basically, I have a gridview that binded from two functions (type datatable). One function is parent which I past one parameter ("DeptID") while loading this table I also called the child funtion which get the parameter from the parent function ("FolderID"). The grid bind fine, but my tast is to place a down arrow at the first child row under the parent and an a up arrow at the last child row and the process repeated for each parent that have one or more rows.
This is where I have been banging head head trying to get this work but has no success.
Parent row data1
Down arrow Child row data - first row
up/down arrow Child row data
up/down arrow Child row data
up/down arrow Child row data
up arrow Child row data - last row
Parent row data2
Down arrow Child row data - first row
up/down arrow Child row data
up/down arrow Child row data
up arrow Child row data - last row
Parent row data3
Down arrow Child row data - first row
up/down arrow Child row data
up arrow Child row data - last row
Parent row data4
Child row data - first row
Any assistance is greatly apprecaited. please provide codes example.
Thanks
DocHoliday.
Here are my codes behind VB:
Protected Sub DisplayParentGV()
Dim Conn As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("mConn").ToString)
Dim SQLCmd As New SqlCommand("Get_Links_Name", conn)
Dim SQLDBDataReader As SqlClient.SqlDataReader
Dim dt As New DataTable()
Try
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
SQLCmd.CommandType = CommandType.StoredProcedure
SQLCmd.Connection = conn
SQLCmd.Parameters.Add("@DeptID", SqlDbType.Int, 60).Value = Convert.ToInt32(Session("Dept_id"))
dt.Columns.Add(New DataColumn("FolderID", GetType(String)))
dt.Columns.Add(New DataColumn("FolderFileID", GetType(String)))
dt.Columns.Add(New DataColumn("ImageType", GetType(String)))
dt.Columns.Add(New DataColumn("Page", GetType(String)))
dt.Columns.Add(New DataColumn("FolderOrder", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileOrder", GetType(String)))
SQLDBDataReader = SQLCmd.ExecuteReader()
While SQLDBDataReader.Read()
Dim dr As DataRow = dt.NewRow()
Dim Pid As Integer = Convert.ToInt32(SQLDBDataReader("FolderID"))
dr("FolderID") = (SQLDBDataReader("FolderID"))
dr("FolderFileID") = Nothing
dr("ImageType") = Nothing
dr("Page") = (SQLDBDataReader("Foldername"))
dr("FolderOrder") = (SQLDBDataReader("FolderOrder"))
dr("Link_FileOrder") = Nothing
Session("ParentBottonRow") = dt.Rows.Count
dt.Rows.Add(dr)
Dim ChildTable As DataTable = DisplayChildGV(Pid.ToString())
For Each dro As DataRow In ChildTable.Rows
Dim dr2 As DataRow = dt.NewRow()
dr2("FolderFileID") = dro("FolderFileID")
dr2("ImageType") = dro("ImageType")
dr2("Page") = dro("Link_FileName")
dr2("Link_FileOrder") = dro("Link_FileOrder")
dt.Rows.Add(dr2)
Next
End While
SQLDBDataReader.Close()
Catch ex As Exception
Throw
Finally
SQLCmd.Dispose()
gvParent.DataSource = dt
gvParent.DataBind()
conn.Close()
End Try
End Sub
Protected Function DisplayChildGV(ByVal FolderID As String) As DataTable
Dim Con As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("mConn").ToString)
Dim dt As New DataTable()
dt.Columns.Add(New DataColumn("FolderFileID", GetType(String)))
dt.Columns.Add(New DataColumn("ImageType", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileName", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileOrder", GetType(String)))
Dim SQLCmd2 As New SqlCommand("Get_Links_Folder_Name", Con)
Try
If Con.State = ConnectionState.Closed Then
Con.Open()
End If
SQLCmd2.CommandType = CommandType.StoredProcedure
SQLCmd2.Connection = Con
SQLCmd2.Parameters.Add("@FolderID", SqlDbType.Int, 60).Value = Convert.ToInt32(FolderID)
Dim SQLDBDataReader2 As SqlClient.SqlDataReader = SQLCmd2.ExecuteReader()
'SQLDBDataReader2 = SQLCmd2.ExecuteReader()
While SQLDBDataReader2.Read()
Dim dr2 As DataRow = dt.NewRow()
dr2("FolderFileID") = SQLDBDataReader2("FolderFileID")
If Not IsDBNull(SQLDBDataReader2("LinkURL")) Then
dr2("ImageType") = ResolveUrl("~/Images/icon-ie.gif")
Else
Select Case Mid(SQLDBDataReader2("Link_FileName"), InStrRev(SQLDBDataReader2("Link_FileName"), "."))
Case ".xls"
dr2("ImageType") = ResolveUrl("~/Images/icon-xls.gif")
Case ".doc"
dr2("ImageType") = ResolveUrl("~/Images/icon-doc.gif")
Case ".pdf"
dr2("ImageType") = ResolveUrl("~/Images/icon-pdf.gif")
Case ".ppt"
dr2("ImageType") = ResolveUrl("~/Images/icon-ppt.gif")
Case ".txt"
dr2("ImageType") = ResolveUrl("~/Images/icon-text.gif")
End Select
End If
dr2("Link_FileName") = SQLDBDataReader2("Link_FileName")
dr2("Link_FileName") = SQLDBDataReader2("Link_FileName")
dr2("Link_FileOrder") = SQLDBDataReader2("Link_FileOrder")
Session("ChildBottonRowBolean") = SQLDBDataReader2.Read().ToString
dt.Rows.Add(dr2)
End While
Return dt
Catch ex As Exception
Throw
Finally
SQLCmd2.Dispose()
'gvParent.DataSource = dt
'gvParent.DataBind()
Con.Close()
End Try
End Function
|
|
|
|
|
Why do you require to deal with first and last row when you can easily do this using
You might consider asp:repeater which already has HeaderTemplate and FooterTemplate to deal with just this.
|
|
|
|
|
Does repeater have the same function as gridview does ?
|
|
|
|
|
I need to get the first and last row because my page allow user to move the order of the child row up/down. Therefore, if the child row is first row then user cannot move it up and same for last row, user cannot move it down.
|
|
|
|
|
Yes ... Repeater has that option. Acutally everything in repeater is created by you. Just use PageDataSource to handle paging. Place values in ViewState and use HeaderTemplate and FooterTemplate to have first and last row.
You might give it a try...
|
|
|
|
|
|
Hello every1
im have a RUNNIG website on a REMOTE SEREVER sometimes i get bad results ,i want to trace my Variables to know thier values at a particular point, here is a list of things i've tried :
1. Response.write() ----not working
2. Trace ="True" ---not working properly i cant show actual values ,especially outside the page for instance in a user control or Class.vb
3.Remote debugging -----the remote site doesnt even open i get this error message
The Web server does not appear to have FrontPage Server Extensions ...
when i tried configuering the IIS in order to add frontpage 2002 , the wizard asked me for Windows Server 2003, i don have any
Is there a way out? Please Please Please Help?
modified on Saturday, December 5, 2009 12:40 AM
|
|
|
|
|
Do error logging
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
I have created a user control that uses an AJAX extender. The problem is when I place the user control on a page a rectangle shaped CalendarExtender icon is shown in the designer. This moves other controls out of place in the designer making it hard get things lined up correctly. When the page runs the CalendarExtender icon is not shown but how can I removed it in the designer?
|
|
|
|
|
Why do you use Designer?
I think using it will end up creating unnecessary codes. use html to define design.
|
|
|
|
|
Hi all,
I am a beginner in javascript, and now I am trying to use it to check validation for an aspx page. I have a button and a textbox. When the button is clicked, the textbox will be checked wether it is empty or not.
I use the following code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" runat="server">
function checkValue2( obj)
{
if (obj.value == "")
alert ("empty");
else
alert ("not empty");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" onclick='checkValue2(forms[0].TextBox1)' />
</div>
</form>
</body>
</html>
And this is the error:
Compiler Error Message: CS1001: Identifier expected
Source Error:
Line 7: <title>Untitled Page</title>
Line 8: <script type="text/javascript" runat="server">
Line 9: function checkValue2( obj)Line 10: {
Line 11: if (obj.value == "")
Could you tell me how can I fix this error?
Thank kiu so much!
|
|
|
|
|
Member 4704143 wrote: When the button is clicked, the textbox will be checked wether it is empty or not.
Member 4704143 wrote: <asp:button id="Button1" runat="server" text="Button" onclick="checkValue2(forms[0].TextBox1)">
Try This :
var TextID="<%TextBox1.ClientID")";
function checkValue2()
{
Var ClientTextID= document.getElementByID(TextID);
if(ClientTextID.value='')
{
alert('text box is null);
}
else
{
alert('text box is not null);
}
}
Please check the syntax.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|