Re-write A String And Convert Http Text Into Actual Web Links?
Nov 27, 2010
In my code below, I'm trying to re-write a string and convert and http text into actual web links.
It doesn't seem to be working and I think the problem may be that I'm rewriting the string and inserting another http string into the original string which then causes problems with the loop.
The ASP.net 3.5 SiteMapPath Control shows the site map but not necessarily the path thru a site. If a user links from one page to another using a hyperlink, the Site Map does not seem to show the actual path, only the site Map. If this is incorrect, please let me know.If it is correct, do you know of another control that will show the actual path thru the site in a session?
If I were to specify a page for redirect using the ASP.NET Custom Errors feature, would my application still spit out the HTTP status code for that particular error?
For example if had a line in my web.config that had all Internal Server Errors redirect to Errors/500.aspx and then I encountered a 500 error, I would then be redirected to my custom Errors/500.aspx page. Will my application still respond with a HTTP 500 at any point in this exchange?
I have two sub routines that I've created to pull in my Membership user roles and assign the value/name of that role to the value of a cookie.
My first subroutine looks like this
[Code]....
At this point, role ID is a 1-dimentional array which is not acceptable for a cookie's value (it must be a string), but in Debug mode, I can see that the array does contain the correct roleID value. In my 2nd subroutine I change the value from array to string for no other reason than that it gives me an opportunity to see that the value of CookieValue() before it is converted does have the correct roleID.
[Code]....
Even though it still shows that string as having the correct value, it returns the object "System.String[]"
I have a products table with 3 fields name, price and quantity, I need to fill a datatable with those 3 fields and using a foreach build a chain. I build my chain currently using a datagrid with my following code
this code work good.
string item_name; string amount; string quantity;
[Code]....
but I like to form my chain directly from datatable, not rely on a datagrid.
How to add different text with different colour in bitmap image using wpf.i have written the code it will take only one colour in text line but i want different colour in bitmap
SolidBrush brush = new SolidBrush(System.Drawing.Color.White); System.Drawing.Brush brush1 = new SolidBrush(System.Drawing.Color.Blue); // draw your rectangle below the original image System.Drawing.Font font = new System.Drawing.Font("Arial", fontsize, System.Drawing.FontStyle.Bold, GraphicsUnit.Pixel); SizeF textSize = new SizeF(); graphics.DrawString(multiLineString, font, brush1, position);
Is there a way to use the firefox (or chrome or any other good browsers) rendering engine to convert html (as a text string) to an image?I have full access to the server I'm using, so no limitations there.
When I use WatiN to go to a specific web page, how can I fake the HTTP referrer with a query string (i.e. request is from google search with query string q=search_term)? So I can verify that the response header has the 301 redirect for specific referrer URL.
The following link: [URL]javascript has a link on the right-hand-side to switch code from C# to VB, but the actual example text does not change when the selection is chosen. Can someone tell me if this tutorial is exclusively for C#, or can it be built in VB as well?
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'Description' vw_aspnet_Applications Description aspnet_Roles Description vw_aspnet_Roles Description aspnet_Applications Description
The above query returns only those columns that are named "Description" from the default asp.net membership tables. That is not what I want. Each column has a property called "Description" which allows the developer to provide a detailed description for each SQL field (a.k.a. "column"). Example: aspnet_Membership has a column "Password" which does not have anything in the "Description" property although it should have imo because without a description, it is not obvious that the password's value happens to be encrypted.
Scenario: Assume that I have a table called Trucks that has data like
Number Odometer ... et cetera
It's schema looks something like this (abbreviated)
COLUMN_NAME Description Number yyyynnnn where 'yyyy' is year truck was purchased, 'nnnn' is sequential number. Odometer most recent odometer reading in kilometres
How would I code a SQL SELECT statement in SSMS 2008 to display the schema data such as a column's name, its description text, et cetera? because "description" is such a generic term, I've so far been unsuccesful at locating further information in Google.
My company purchased ActivePDF WebGrabber a couple of years ago to convert a classic ASP created HTML page into a PDF form. The only drawback with the tool that we continually run into is that the outputted HTML links are not hot. Are there any tools that do include hot-links within the HTML to PDF output?
According to the ActivePDF FAQ for Does WebGrabber convert hyperlinks into usable links in the output PDF?, the answer is no. There is a phrase confusing me at the end of the answer:
"To implement links in the final PDF, the application would search for links prior to the Postscript generation, and append them once the PDF has been generated using Toolkit."
Does that mean this is how to achieve it, or is this their theoretical but not tested solution? If this is the solution, has anyone done this that might be able to post some sample (pseudo-)code?
Edit: I should mention that we're open to a different tool, and we need it to be accessible via classic ASP and ASP.NET. I would prefer a solution in which the links are automatically hot-linked during PDF generation.
I'm trying to write an HTTP GET handler. The path should start with http://site/processTask and have a set of URL-encoded parameters. I have the following in my web.config
now when I type the URL http://mysite/processTask in browser I get HTTP 404 but if I change the add verb line to the following one:
<add verb="GET" path="processTask.asmx*" type="MyHandler.ProcessTaskHandler, MyHandler"/> and type http://mysite/ProcessTask.asmx in browser the handler is run and I get the response from the handler. What's the problem? Why is the handler run only when the path contains .asmx? How do I change web.config so that .asmx is not required?
I am passing some data in HTTP body using the Ajax request. These contents on server are accessible using Request.InputStream. Now i want to write it to file on server disk Asynchronously. How to do that ?
If the data sent using the HTTP is more then i don't want server application to die/get affected. So that i would like to write it Asynchronously.
Following is sample for reference regarding what i am trying to do ...
System.IO.Stream str; // Create a Stream object. str = Request.InputStream; // TO DO Write it to file asyncronously ... str.Write(someFile, 0, strLen);
The thinking behind the question is that my image current reads it's data from a custom httphandler that gets the image from the database. I want to be able to use a file upload control to "post" a replacement file back to a "write" handler, updating the database. Then I can refresh my image using javascript to the original "read" handler. Is this possible?
I currently have a standard postback model upload process which puts the image into the database and a custom handler to read it back. What I want to know, is can you create a custom http handler to perform the upload so I could asynchronously call the upload handler then refresh the image src to pull it back from the database. At the moment I am using the IFrame approach to make it appear asynchronous, I just want to know the best practice really
problem with Stream.Write() where it works under a dev (Windows 7) environment but fails under a server environment (Windows 2008 R2 Enterprise)?
I'm basically working with some third party code which reads from a FileStream and writing to an Http request, nothing unusual and it's doing the following things:
Ensuring that Response.KeepAlive is false (was originally true but worked W7 and not W2K8 so tried false but it doesn't ); Ensuring that the Write includes the length of the bytes to write; Ensuring that I Flush the stream afterwards;
The error that I encounter is the rather vague 'The request was aborted: The request was canceled.' with InnerException of 'Cannot close stream until all bytes are written.'. Now, my code works perfectly under Windows 7 so I still suspect that something is actively blocking this writing although I am not sure what, how and where.
One other possibility I wondered about was whether the encoding might be different under Windows Server 2008 R2 as opposed to Windows 7?
Here's a code snippet from the relevant method (a bit convoluted but, disclaimer, I didn't write it :-):
on VWD 2005 this code works fine, but on 2008 it says I haven't created an instance of the object. I want to convert the object connString (a connection string) into a string.
'This acceses the virtual directory web.config file for connection strings 'We have to convert the object to a connection string Dim rootWebConfig As System.Configuration.Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/VirtualDirec") Dim connString As System.Configuration.ConnectionStringSettings connString = rootWebConfig.ConnectionStrings.ConnectionStrings("ConnectString1") Dim strConnString As String = connString.ToString().......
I have project in development where string operations like "Hi " + variable + ", welcome to Project" are used at many places (given example is very minor one).
One of the requirement is to convert it to string.format style.
It is very long and tedious job, where I would not like to break earlier working code due to any human error might happen while converting it.
I would like to if any Macro or VS command which I can create to handle it. Just like we mark block of code and do Extract function in Re-factor options.
I have this simple html page that talks to a microchip. It turns a LED light on and off.
[Code]....
**************
Can someone give me some pointers on how to convert the above to asp.net. I have put two asp:buttons on a webForm. Then for the button clickevent of the btnOn would I use something this like this? Or is WebRequest the wrong concept to use? I can seem to get this code to work for me!