|
That's OK on the late reply, it's a discussion, and I got it working using a class with get and set to accept a JSON array of items. So I understand how to pass non-primitives to a web service now.
I find XML to be really fast. I use XML reader and writer, and a class file to code against. So basically each xml element is like an array, that can be resized with Array.resize.
And yes it does help solidify the techniques needed to accomplish the task.
Thanks for collaborating with me on the subject. Guess not that many people are at that level yet.
|
|
|
|
|
hehe It's my pleasure to have a good discussion and help someone out.
XML is not slow for your eye, but it's really slow when it comes to traversing the nodes (i.e. compared to others of course). Anyways, am sure for your purpose it won't effect much. However I'll try to write a sample code that would perform json serialization easily, over the weekend, and share it.
regards
|
|
|
|
|
It's a holiday weekend here, labor day, but I may send another array to a web service next week. I'm reworking my shopping cart and checkout program, implementing better and faster code, while cleaning up.
Have a great weekend!
|
|
|
|
|
I am using Page.Response.Redirect and the following code is not working:
Page.Response.Redirect("test.aspx")
I never get to the requested page.
I have tried
Page.Response.Redirect("test.aspx", false )
and that does not work.
The code that calls the routine is the following:
onKeyPress="return numbersonly(this, event)"
The user has to enter a value in the textbox for the code to work.
Do you think I need to setup the absolute path in this call?
Thus do you think I need another event to trigger the call to the correct method call?
What would you suggest?
|
|
|
|
|
Correct me if I'm wrong on this
Objects like Request, Response, Server are part of the HttpContext, which I think is a link to the web server, and allows the web server to communicate with asp.net
So when you get more advanced with your code, and you no longer bind objects, then you use
httpContext.current.response.redirect("~/default.aspx")
As far as the folder system goes
If I have a folder structure like
/
/images/
/admin/management/login.aspx
/admin/management/logout.aspx
I'm in the root, and want the image folder
redirect(~/images/default.aspx")
I'm in /admin/management/ and I want the logout page
redirect("logout.aspx")
now I want the root default
redirect("~/")
Using Page is for talking to Page Objects, like the header tag, script tags, register a script via the client script manager
Hope that helps
|
|
|
|
|
dcof wrote: The code that calls the routine is the following
Page.Response.Redirect is a server-side function, yet return numbersonly(this, event) appears to be a call to a JavaScript function. That's not going to work. Here is an example of how you can do a server-side redirect:
<%@ Page Language="vb" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub btnTest_Click(sender As Object, e As System.EventArgs)
Page.Response.Redirect("http://www.google.com/")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Redirect</title>
</head>
<body>
<form id="frmMain" runat="server">
<asp:Button runat="server" ID="btnTest" Text="Redirect" onclick="btnTest_Click" />
</form>
</body>
</html>
If you want to do it with JavaScript, it would be different (you'd use window.location ).
|
|
|
|
|
|
Can you show me how you use
"window,location("/index.aspx");"
in javascript?
how would you wire up this feature to the web form page?
|
|
|
|
|
I didn't mention that to you, I posted that to stein in a post below yours.
You would have to read all the post to get the full story on that. But it includes some samples on how to wire it up. Read the post first,
[^]
[edit]
I did write that to you, still not clear if your posting back, or trying to do that on the client side.
|
|
|
|
|
Even though the post you pointed out to me looks like it would work, I would rather post back to the server. I need to obtain some data from the server.
How ould I post back to the server?
|
|
|
|
|
|
<html>
<body>
<table id="thread-board">
<tr>
<td width="68%">Subject</td>
<td width="12%">Username</td>
<td width="20%">Date Posted</td>
</tr>
<%=ShowMessages(0)%>
</table>
</body>
</html>
'/////////////////////////////////////////
'///// THREAD - MESSAGES //////////////////
intLevel = 0
Function ShowMessages(intParent)
intLevel = intLevel + 1
strSQL = "SELECT * FROM fmsg WHERE fmsg.msg_parent = " & intParent & " ORDER BY CDATE(msg_date) DESC "
Set rstForumMessages = conn.Execute(strSQL)
Do Until rstForumMessages.EOF
response.write("<tr>")
response.write("<td width='68%'><img src='dot.gif' width='" & ((intLevel * 24)-24) & "'>" & rstForumMessages("msg_object") & "</td>")
response.write("<td>" & rstForumMessages("msg_uid") & "<td>")
response.write("<td>" & rstForumMessages("msg_date") & "<td>")
response.write("</tr>")
ShowMessages(rstForumMessages("msg_id"))
rstForumMessages.MoveNext
intLevel = intLevel - 1
Loop
End Function
'///// THREAD - MESSAGES //////////////////
'////////////////////////////////////////
The function above is an asp classic function that I used to display messages and replies in a forum (a sort of treeview). I tried to translate it in asp net but it doesn't work properly.
Imports System
Imports System.IO
Imports system.web.ui
Imports system.web.ui.webcontrols
Imports system.web.ui.htmlcontrols
Imports system.configuration
Imports system.data
Imports system.data.oledb
Public Class Messages
Inherits page
'////////////////////////////////
Dim CN As OleDb.OleDbConnection
Dim CMD As OleDb.OleDbCommand
Dim SQL As String
Dim ODR As OleDb.OleDbDataReader
Dim ODR2 As OleDb.OleDbDataReader
'/////////////////////////////////////
Function ShowMessages(intParent As Integer) As String
Dim tt2 As String = String.Empty
SQL = " SELECT * FROM fmsg WHERE msg_parent=" & intParent
CMD = New OleDbCommand(SQL, CN)
CN.Open()
ODR2 = CMD.ExecuteReader()
If ODR2.HasRows Then
tt2 = ""
While ODR2.Read
intLevel = intLevel + 1
tt2 += "<table>"
tt2 += "<tr>"
tt2 += "<td rowspan=""2""><img src='dot.gif' style='width:" & ((intLevel * 14) - 14) & "px' /></td>"
tt2 += "<td class='child-title'>" & ODR2("msg_id") & " - " & ODR2("msg_object") & "</td>"
tt2 += "</tr>"
tt2 += "<tr>"
tt2 += "<td class='child-body'>" & ODR2("msg_body") & "</td>"
tt2 += "</tr>"
tt2 += "</table>"
tt2 += getChildNode(ODR2("msg_id"))
intLevel = intLevel - 1
End While
tt2 += ""
End If
CN.Close()
Return tt2
End Function
End Class
modified 9-Aug-12 14:58pm.
|
|
|
|
|
Help with what? Not many people are going to read through this unformatted mess. You did not say what you are trying to do nor did you say anything about any problem.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Sorry for the messy code. I forgot to use preformatted text for the code.
|
|
|
|
|
Which ones which, they both look like classic asp to me,
I must admit that Wes is right on your post and code looking like a mess, That's one messy hay stack you have there.
Clean it up for help
|
|
|
|
|
Sorry for the messy code. I forgot to use preformatted text for the code.
|
|
|
|
|
This is more along the lines of asp.net, in pure form. I don't know what the outside of the haystack looks like, so I have no clue where to inject the html
The use of response.write was popular in classic asp and echo in php, but I think it's poor programming practice. I don't know what the alternative is, I left asp back in 2003, and php in 2005.
Private Sub ShowMessages(ByVal iParent As Integer, ByVal pContainer As Panel)
Dim message(3) As String
Dim myConnectionString As String
myConnectionString = ice5commerce.common.iCE5IniFile.GetSQLConnString()
Dim mySelectQuery As String = "SELECT * FROM fmsg WHERE msg_parent=@Parent"
Dim myConnection As New SqlConnection(myConnectionString)
Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
Dim paramParent As SqlParameter
paramParent = New SqlParameter("@Parent", SqlDbType.Int)
paramParent.Value = iParent
myCommand.Parameters.Add(paramParent)
Try
myConnection.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
While myReader.Read()
message(0) = myReader.GetBoolean(0).ToString 'mID
message(1) = myReader.GetString(1).ToString 'mObject
message(2) = myReader.GetString(2).ToString 'mBody
End While
myReader.Close()
myConnection.Close()
myReader = Nothing
Catch ex As Exception
End Try
myCommand = Nothing
myConnection = Nothing
If (message.Length > 0) Then
Dim table_Container As Table
table_Container = New Table
With table_Container
.CellPadding = 0
.CellSpacing = 0
.Style.Add(HtmlTextWriterStyle.Width, "100%")
.Attributes.Add("border", "0")
End With
pContainer.Controls.Add(table_Container)
Dim tr_TitleRow As TableRow
tr_TitleRow = New TableRow
table_Container.Controls.Add(tr_TitleRow)
Dim td_TitleRow_Left As TableCell
td_TitleRow_Left = New TableCell
With td_TitleRow_Left
.RowSpan = 2
.Style.Add(HtmlTextWriterStyle.Width, "25%")
End With
tr_TitleRow.Controls.Add(td_TitleRow_Left)
Dim img_UserLevel As UI.WebControls.Image
img_UserLevel = New UI.WebControls.Image
With img_UserLevel
.ImageUrl = "~/image/dot.gif"
End With
td_TitleRow_Left.Controls.Add(img_UserLevel)
Dim td_TitleRow_Right As TableCell
td_TitleRow_Right = New TableCell
With td_TitleRow_Right
.Style.Add(HtmlTextWriterStyle.Width, "25%")
End With
tr_TitleRow.Controls.Add(td_TitleRow_Right)
Dim tr_MessageBody As TableRow
tr_MessageBody = New TableRow
table_Container.Controls.Add(tr_MessageBody)
Dim td_MessageBody As TableCell
td_MessageBody = New TableCell
With td_MessageBody
.CssClass = "child-body"
.Text = message(3)
End With
tr_MessageBody.Controls.Add(td_MessageBody)
Else
'No record was found
End If
End Sub
|
|
|
|
|
Hi,
I am using a gridview (asp.net). in which I have a formatting done to the cells with border color = Black.
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-color: Black";
}
}.
The same is working fine locally, but when deployed the Black lines becomes bold and thick.
Any one Please help on this. Awaiting response !!!!
|
|
|
|
|
Does it happen across all browsers? What happens if you explicitly set the border-width to "thin"?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
We are using Quartz schedular for one of my project.
I'am getting exception when GetSchedular method is called. Exception is "File quartzjobs.config not found"
Both Files (where GetScheduler() method is called & quartzjobs.config) are in same folder.
Below is the code:
ISchedulerFactory factory = new StdSchedulerFactory();
_scheduler = factory.GetScheduler();
XML is
<add key="quartz.plugin.xml.fileNames" value="quartzjobs.config">
Regards,
Shirish.M
|
|
|
|
|
Sounds like you're missing a configuration-file. People here will not have that much experience with the scheduler, I suggest you repost your question on their support-forum[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
content management system in asp.net
|
|
|
|
|
Member 9325229 wrote: content management system in asp.net
This is a forum where on can ask questions. This is not a question. It's not even a statement.
Try again.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Yeah...what about them?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
In an existing 2010 C# web form application, I want to setup a hyperlink that will take the user to a new web form page.
1. The user will basically enter some data into a textbox and the user will be redirected to the new web form page. The user will be redirected to the new web page when they that are in the _text_changed event.
2. The other option is that the user will click on a label and be redirected to the new web page.
What I have tried does not work so far. Thus can you tell me and/or point me to a reference that will show me how to setup this code?
|
|
|
|