Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Monday, March 26, 2012

Suggested means to cope with commas etc.

G'day,
In a typical 'contact us' type page what is a recommended way to ensure a message text box gets dealt with properly rather than break at comma's etc.

Is it as simple as using server.encodeHTML() on every passed variable? When I do this I still seem to have problems.

GeoffWhy would you break at commas? I don't get the problem.
Sorry. Error was happening when writing a record of the email to a database.

So if I can change my question...

Is there a best-practice' approach to handling commas etc. when writing to database eg:..."insert into myTable message = '" & server.encodeHTML(msg.text) & "'" is the sort of thing that was breaking if a comma existed in the textbox called msg?

Thanks,

Geoff
The commas should not mess it up within the quotes.

If an apostrophe appears within the string ('), then it will close the string and this is what will mess it up.

The best practice is to use Parameters. These will take care of all these issues as well as protect you against SQL injection and a few other problems you may not have noticed yet.

Saturday, March 24, 2012

sugggestion

Hello,

Anybody can tell me why I am getting this error while running ASP.NET Web Application. Before running some other same type of web form, I was not having any difficulty.

I am using virtual lab for "Developing Microsoft® ASP.NET Web Applications Using Visual Studio® .NET"

ruprety

Server Error in '/WebApplicationXML' Application. ('/WebApplicationXML' is Project name)
------------------------

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 'WebApplicationXML.Global'.

Source Error:

Line 1: <%@dotnet.itags.org. Application Codebehind="Global.asax.vb" Inherits="WebApplicationXML.Global" %
Source File: c:\inetpub\wwwroot\WebApplicationXML\global.asax Line: 1

------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573Hi,
Usually it happens if application was not compiled successfully.

sunken in textboxes anyone?

Hi folks,
first of all I'm using ASP.net 1.1 with C#

In the good old MS Access days you had sunken in textboxes to tell users
that they could type stuff in that box and flat textboxes to indicate a 'read
only' intention.
my colleagues and I are developing on an Intranet with IE6 only...

I notice that all my ASP.net <asp:textbox> come out flat in IE6 on my XP Pro
machine. is there anywhere or any way I can make those <asp:textbox> controls
appear sunken in, in some cases, and flat in others?

Regards and thanks in advance,
CharlesAHi Charles,

Try adding this to your CSS stylesheet:

input.sunken
{
border: 2px inset;
}

Then set the CssClass property of your TextBox to "sunken".

HTH,

Chris
Thanks for that Chris!

sunken in textboxes anyone?

Hi folks,
first of all I'm using ASP.net 1.1 with C#
In the good old MS Access days you had sunken in textboxes to tell users
that they could type stuff in that box and flat textboxes to indicate a 'rea
d
only' intention.
my colleagues and I are developing on an Intranet with IE6 only...
I notice that all my ASP.net <asp:textbox> come out flat in IE6 on my XP Pro
machine. is there anywhere or any way I can make those <asp:textbox> control
s
appear sunken in, in some cases, and flat in others?
Regards and thanks in advance,
CharlesAHi Charles,
Try adding this to your CSS stylesheet:
input.sunken
{
border: 2px inset;
}
Then set the CssClass property of your TextBox to "sunken".
HTH,
Chris
Thanks for that Chris!

Thursday, March 22, 2012

Support Trouble ticket type deal

I'm trying to make a support ticket system, I would like to know

How would you display how many replies an issue hasthe date of the last replyThanks

What is your DB architecture like?

I would have 2 tables:
(1) Tickets which contains all ticket information such as title, issue, member who submitted the ticket, createDate, and TicketID.
(2) TicketReplies which contains all replies for a ticket, a createDate, and a foreign key TicketID.
You can set createDate default binding = getDate() which will return the current dateTime.

If you need to know how many replies there are for a ticket you can run:
SELECT COUNT(*)
FROM TicketReplies tr
JOIN Tickets t
ON tr.TicketID = t.TicketID
WHERE t.TicketID = (whatever the ticket is that you are interested in)

If you need to know the date of the last reply you can run:
SELECT *
FROM TicketReplies tr
JOIN Tickets t
ON tr.TicketID = t.TicketID
WHERE t.TicketID = (whatever the ticket is that you are interested in)
ORDER BY CreateDate DESC