|
i am using xml to import data to my web page. Information is displaying but xsl style sheet is not applying please tell me, whats the problem .... Please my code is :
Dim xmlPath As String = Server.MapPath("XMLFile.xml")
Dim xslPath As String = Server.MapPath("XSLTFile.xsl")
Dim fs As FileStream = New FileStream(xmlPath, FileMode.Open,FileAccess.Read)
Dim reader As StreamReader = New StreamReader(fs, Encoding.UTF8)
Dim xmlReader As XmlTextReader = New XmlTextReader(reader)
'Instantiate the XPathDocument Class
Dim doc As XPathDocument = New XPathDocument(xmlReader)
'//Instantiate the XslTransform Class
Dim xslDoc As XslCompiledTransform = New XslCompiledTransform()
xslDoc.Load(xslPath)
Dim sw As StringWriter = New StringWriter()
xslDoc.Transform(doc, Nothing, sw)
' //Close Readers
reader.Close()
xmlReader.Close()
Response.Write(sw.ToString())
Please help me...
Feroze
|
|
|
|
|
Hi Feroze!
Why aren't you using the XML-Control (found in the Toolbox)?
With this you just need to apply the XML-Source and the transformation file.
e.g:
Dim xmlDoc As New XmlDocument()
xmlDoc.Load("your path to the xml-data goes here")
With yourXmlControl
.Document = xmlDoc
.TransformSource = "your path to the xsl-file goes here"
End with
This is all what needs to be done.
- walter
|
|
|
|
|
I am currently using a shared server with discount ASP.
I want to know if anyone of you have better experience in term of speed and efficiency with other webhosts.
please share your views
|
|
|
|
|
This site gives better performance and have much better features.
http://www.m6.net
|
|
|
|
|
|
|
Please give some details.
|
|
|
|
|
sorry about that.
i am developing a project that needs to store the encrypted admin password in a separate file (admin.xml). this file is located in wwwroot/project/bin/FILES/
this works fine until the user changes the password, in which case the password is saved in the "admin.xml" file.
after the file update, the session expires
i can't figure out why?
the password changing page is at the location wwwroot/project/GUI/chPassword.aspx
any suggestions?
thanks in advance.
|
|
|
|
|
I'd like to know whether it is possible to set different HeaderStyle for different columns in Gridview. I tried to put headerstyle cssclass tags in different columns. But this method is not working. Is there a way to do it?
Thank you so much in advanced
bin bin
|
|
|
|
|
i think this will work or you can also add it dynamically at ItemDataBound event.
< asp:BoundColumn HeaderText="Heading1" >
<HeaderStyle CssClass="class1"></HeaderStyle>
< /asp:BoundColumn >
Regards
Shajeel
|
|
|
|
|
Thanks for your reply.
It tried to define it in the asp:BoundColumn. But it seems the header style defined in the column won't override the style of the whole header. Should I use z-index to make it work?
The header style defined for column is not working at all.
Thank you again.
|
|
|
|
|
it is overriding for me when i am using both Header Style on Grid and Header Style on individual columns.
Regards
Shajeel
|
|
|
|
|
Hi,
I have a strange problem that I could use some help with.
Using Visual Web Developer I have a solution using ASP2 that has a master page with one content pane. I then:
- added a webform to my solution based on the master page. This is Default.aspx
- added a label to the content pane of Default.aspx
- set the text property of the label to be "Line1 Line2"
Running the page in the browser shows BOTH lines on the same line (1st line), i.e. the second line is written over the first line.
I then added another webform to the solution but did not base it on the master page. To this webform I added a label and set the text property to "Line1-no-master Line2-no-master". This works fine. On line 1 I get the text "Line1-no-master" and onthe line below is the text "Line 2-no-master".
Question is, why does the master page based solution above not work? Is there a known workaround or a solution that someone can suggest?
I'm tearing my hair out over this....!!!
All help appreciated..
Thanks,
|
|
|
|
|
Hello ...
I am creating a website using asp.net1.1(visual studio2000 with C# code) and Sqlserver2000 ...
I want to create a place so that the admin can post a message ( like posting message here) ... I need a text editor,like adding smiley,changing font ( formatting)... How can I do it...?
please help me.
thank a lot dear friends.
|
|
|
|
|
You can take this textbox as an example. Assign some values for each and every smileys and while storing or sending attach the smileys.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
|
Hi.
I have a class derived from System.Web.UI.Page that contains a fileupload control and code to handle the uploading and some other tasks.
Now if i inherit another class from this all the correct methods are called however the control (upload) returns false to HasFile - I dont have the object defined in the inherited class's code behind file but i do have it in the html so as it can be rendered.
Is the control getting hidden or some thing as if i have it defined in the inherited page and inherit it just from System.Web.UI,Page it works fine.
I have a similar setup with a Datagrid and that works and renders fine.
Is what I am doing a bad way to design my pages or is there a way it can work?
Thanks for any help.
|
|
|
|
|
I have a button click and what I need to do is too things:
1. Send an email to the value of what was selected from a required dropdown list of people
2. Then send the user to another page.
I wanted to do both of these in the code behind, and it's been decided the application owner (person who's funding the application) would like to use the client's email application (ie. Eudora, Outlook, etc.) when sending this email.
I'm not sure how to replicate the href='mailto:person@person.com' that's possible with the anchor tag.
|
|
|
|
|
What you may consider doing is adding a client-side click handler that opens the mailto link in a new window. So long as you don't return false from the client event, then your server-side Click event will still fire so that you can call your redirect there. For example:
<asp:Button ID = "test" OnClick = "Button_Click" OnClientClick = "window.open('mailto:user@server.ext'); return true;" Text = "Click Me" runat = "server"/>
Hope that helps.
--Jesse
|
|
|
|
|
|
Here is the subroutine I’m using to recover the employee’s information from the database.
Protected Sub Load_EmployeeInfo_To_Edit(ByVal intEmployeeID As Integer)
'Purpose: Loads the selected employee's information for editting
'Parameters: intEmployeeID as Integer; The Employee's ID number
'Returns: Nothing - populates the textboxes in the Employees.aspx page
Dim cn As SqlConnection = New SqlConnection(MRMFunctions.WebConfigConnString)
cn.Open()
Try
Dim cd As SqlCommand = New SqlCommand("mrmsp_RetrieveEmployeeForEditting", cn)
cd.CommandType = Data.CommandType.StoredProcedure
'Load the parameters from the stored procedure into the web form
'cd.Parameters.Add("@varEmployeeID", Data.SqlDbType.Int)
'cd.Parameters("@varEmployeeID").Direction = Data.ParameterDirection.InputOutput
cd.Parameters.Add("@varTitleID", Data.SqlDbType.Int)
cd.Parameters("@varTitleID").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varDeptID", Data.SqlDbType.Int)
cd.Parameters("@varDeptID").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varLName", Data.SqlDbType.NVarChar)
cd.Parameters("@varLName").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varFName", Data.SqlDbType.NVarChar)
cd.Parameters("@varFName").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varMI", Data.SqlDbType.NVarChar)
cd.Parameters("@varMI").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varAddrTypeID", Data.SqlDbType.Int)
cd.Parameters("@varAddrTypeID").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varAddress1", Data.SqlDbType.NVarChar)
cd.Parameters("@varAddress1").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varAddress2", Data.SqlDbType.NVarChar)
cd.Parameters("@varAddress2").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varCity", Data.SqlDbType.NVarChar)
cd.Parameters("@varCity").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varStateID", Data.SqlDbType.Int)
cd.Parameters("@varStateID").Direction = Data.ParameterDirection.Output
cd.Parameters.Add("@varZip", Data.SqlDbType.NVarChar)
cd.Parameters("@varZip").Direction = Data.ParameterDirection.Output
txtID.Text = CStr(intEmployeeID)
intTitleID = cd.Parameters("@varTitleID").Value
intDeptID = cd.Parameters("@varDeptID").Value
strLName = cd.Parameters("@varLName").Value
strFName = cd.Parameters("@varFName").Value
strMI = cd.Parameters("@varMI").Value
intAddrTypeID = cd.Parameters("@varAddrTypeID").Value
strAddr1 = cd.Parameters("@varAddress1").Value
strAddr2 = cd.Parameters("@varAddress2").Value
strCity = cd.Parameters("@varCity").Value
intStateID = cd.Parameters("@varStateID").Value
strZip = cd.Parameters("@varZip").Value
Catch ex As Exception
Msg = ex.Message
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
Finally
cn.Close()
End Try
End Sub
For those who need to see the Stored Procedure it is:
USE databasename;
GO
IF OBJECT_ID('mrmsp_RetrieveEmployeeForEditting','P') IS NOT NULL
DROP PROCEDURE mrmsp_RetrieveEmployeeForEditting;
GO
CREATE PROCEDURE mrmsp_RetrieveEmployeeForEditting
@varEmployeeID INT,
@varTitleID INT OUTPUT,
@varDeptID INT OUTPUT,
@varLName VARCHAR(25) OUTPUT,
@varFName VARCHAR(15) OUTPUT,
@varMI VARCHAR(1) OUTPUT,
@varAddrTypeID INT OUTPUT,
@varAddress1 VARCHAR(40) OUTPUT,
@varAddress2 VARCHAR(40) OUTPUT,
@varCity VARCHAR(40) OUTPUT,
@varStateID INT OUTPUT,
@varZip VARCHAR(10) OUTPUT
AS
SELECT @varTitleID = tblEmployees.[TitleID],
@varDeptID = tblEmployees.[DeptID], @varLName = tblEmployees.[LName],
@varFName = tblEmployees.[FName], @varMI = tblEmployees.[MI],
@varAddrTypeID = tblAddresses.[AddressTypeID],
@varAddress1 = tblAddresses.[Address1],
@varAddress2 = tblAddresses.[Address2],
@varCity = tblAddresses.[City],
@varStateID = tblAddresses.[StateID],
@varZip = tblAddresses.[ZipCode]
FROM databasename.dbo.tblEmployees
INNER JOIN databasename.dbo.tblAddresses
ON databasename.dbo.tblEmployees.EmployeeID =
databasename.dbo.tblAddresses.EmployeeID
WHERE databasename.dbo.tblEmployees.EmployeeID = @varEmployeeID
AND databasename.dbo.tblEmployees.Deleted = 0
The intEmployeeID parameter is the only parameter that is showing up. The ones below the txtID.Text are empty. When I ran the Stored procedure within SQL Server the information was there. Does anyone have any idea why this is not working?
Thanks
Quecumber256
|
|
|
|
|
You don't seem to ever execute the stored procedure after setting up all of the parameters. As you, for some reason, are returning all of your data through OUT parameters, you should add the call cd.ExecuteNonQuery() after you finish adding your parameters. Also, don't forget to call the Dispose method on both the command and connection to free up the unmanaged resources.
Hope that helps.
--Jesse
|
|
|
|
|
Thank you. I completely overlooked that.
Quecumber256
|
|
|
|
|
I put in the ExecuteNonQuery command and now I'm getting this:
String[3]: the Size property has an invalid size of 0.
What's causing this?
Thanks,
Quecumber256
|
|
|
|
|
I'm guessing you haven't told the parameters the expected size of the result, and it has defaulted to zero. In your stored proc you declare the various parameters with a size (e.g. @myParam VARCHAR(25) ) add that information to the parameter definition.
Or better yet, ditch this and use ExecuteDataReader and get the data out that way (i.e. remove all but the input parameters). Using output parameters is okay for one or two values, but this is a wee bit much.
|
|
|
|