|
Hi all,
When writing an email in response to a button, I compose the content of the mail from php, using (amongst others) the sprinf instruction in order to create columns with fixed widths:
$msg .= sprintf ("%-10s", $item['number']);
$msg .= sprintf ("%-30s", $item['product']);
$msg .= sprintf ("%-5s", $item['size']);
$msg .= sprintf ("%-12s", $item['color']);
$msg .= sprintf ("%9d" , $item['quantity]);
$msg .= sprintf ("%11.2f", $total);
$msg .= "\n";
etc. However, these widths are not always the same in the different rows, resulting in extremely messy emails! I have tried replacing the spaces with periods (sprintf ("%'.-10s",.....) which still gives different column width over de rows. Does anyone have a solution for this problem please?
Thanks in advance,
William
|
|
|
|
|
Is there a way to hide all of your query paramters in the URL so the user cannot change the values? For example, instead of http://localhost:4777/LINQ/DML/Grid%20View%20-%20select/HyperLinkOrderDetails.aspx?aOrderID=10248&CustomerId=VINET, can we change the URL to simply be: http://localhost:4777/LINQ/DML/Grid%20View%20-%20select/HyperLinkOrderDetails.aspx (thus not showing the orderID or Customer ID?)
Thanks!
|
|
|
|
|
Yes, you can, you make use of POST method, rather than GET method on the form which is submitting the query. If you are still having some trouble, perhaps posting a code snippet of how you navigate to this page, would be of great benefit for us to help you out.
|
|
|
|
|
Sure...I basically have a linqdata source retrieving the Orders table from northwind. I then have a grid displaying the OrderId, Shipped Date and a new column that is a hyperlink. The hyperlink will build a DataNavigateURL to pass the orderID and customerId to a new page (HyperLinkOrderDetails.aspx?aOrderID={0}&CustomerId={1}).
Any way that I can only display http://localhost/HyperLinkOrderDetails.aspx instead of http://localhost/HyperLinkOrderDetails.aspx?aOrderID=ABCD&CustomerId=12345?
<asp:gridview id="GridView1" runat="server" allowpaging="True" xmlns:asp="#unknown">
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="OrderID"
DataSourceID="dsOrders" onrowcreated="GridView1_RowCreated"
onrowdatabound="GridView1_RowDataBound"
onrowcommand="GridView1_RowCommand">
<columns>
<asp:commandfield showselectbutton="True" />
<asp:boundfield datafield="OrderID" headertext="OrderID" insertvisible="False">
ReadOnly="True" SortExpression="OrderID" >
<asp:boundfield datafield="ShippedDate" headertext="ShippedDate">
SortExpression="ShippedDate" >
<asp:hyperlinkfield>
DataNavigateUrlFields="OrderId, CustomerId"
DataNavigateUrlFormatString="HyperLinkOrderDetails.aspx?aOrderID={0}&CustomerId={1}"
HeaderText = "Order Details"
Text="View order details" />
</asp:hyperlinkfield></asp:boundfield></asp:boundfield></columns>
</asp:gridview>
<asp:linqdatasource id="dsOrders" runat="server" xmlns:asp="#unknown">
ContextTypeName="NorthwindDataContext" TableName="Orders">
</asp:linqdatasource>
|
|
|
|
|
Hi,
you can use the Sessionstate, Viewstate or Cookies to store your data.
Hope it will help you.
Greeting, Ralph
|
|
|
|
|
Hello,
I'm trying to understand more about when and why we should use URLEncode for asp.net. Currently I don't use it anywhere in my DetailView. Basically, anytime I request information from the users, I have a DetailView control where they input the information, along with validation controls to verify content/busines rules. Once they submit it, the row is inserted into the db.
1) Should URLEncode be used anytime you gather data from a user?
2) When should it (or should not) be used?
3) Is the general idea behind URLEncode to allow your application to accept special characters ' & / <>, but in a safe way b/c we're encoding them.
4) Is the actual string stored with the hexadecimal charactes in the db...thus you have to decode if you're displaying the data from the db?
Thanks!
|
|
|
|
|
Hi,
I have an activeX object on my page and the script below to interact with it. I'd like to move this script into a .js file and reference it using standard hash include at the top of the html. (right now the script works when it sits at the bottom of my index.html file.
With my limited javascript experience it seems that I can't put tag into a .js file. Is there another way to accomplish this?
<pre>
<html>
...
ATL ActiveX object
...
</html>
<script for="CMyWebPlugin" event="genericJavaScriptEvent(methodName, parameters)">
if (methodName == "LaunchApp")
{
LaunchApp();
}
if (methodName == "login")
{
MyLogin(LoginDiv, parameters);
}
if (methodName == "logout")
{
MyLogout(LogoutDiv, parameters);
}
</script></pre>
|
|
|
|
|
Why hash-include, in particular? If you just want it to be in an external file, can't you use something like:
<script src="myjsfile.js" for="CMyWebPlugin" event="genericJavaScriptEvent(methodName, parameters)"></script>
and save everyhing between your script tags in myjsfile.js ?
|
|
|
|
|
Thanks, that works for me
Chris
|
|
|
|
|
i have recently installed vs 2005 and ajax controll toolkit.
i am able to see all the ajax controlls in my handy tool bar
but only tab control is missing from them. when i try to
write the tab control manually in code view, inteliscence doesn't
show support. what should i do. please help?
|
|
|
|
|
Try looking for the Control in Tool Box, from
Tools -> Choose Toolbox Item
|
|
|
|
|
Hi everybody,
I am writing a website that is based on an iframe (i know, not everybody likes iframes, but my client wants music playing on the background that will not be interrupted by pages changes) I want the new pages to be called-in by a little piece of javascript, for which I use the following line:
"<td><a href="javascript:selectPage(0)" target="content">home</a></td>"
However, I keep getting the errormessage that the function "selectPage" is not defined. When I change the code to:
<td><a href="#" onclick="javascript:selectPage(0)" target="content">home</a></td>
Then everything works. The only problem here is that it loads the entire page in the "content" frame, and the part that I want only every other time.
Does anyone have an idea why the "selectPage" function is not recognised in the href, although it is found when placed in an "onclick"?
Thanks in advance,
William
|
|
|
|
|
Hint: tich the "Ignore HTML tags in this message (good for code snippets)" box bext time you post code...
The href property expects to see a URL (absolute or relative), so unless your selectPage function returns this you will get an error. Take the target="_blank" out of your second example, and do everything in your JS function.
|
|
|
|
|
|
With JavaScript? You're joking, right...?
|
|
|
|
|
Phil Uribe wrote: You're joking, right...?
No. Everyone knows that you can do anything to a client pc or server using the latest version of javascript, only they renamed it ivewrittenavirus to reflect its real capabilities
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: they renamed it ivewrittenavirus to reflect its real capabilities
It's actually been there for a long time. It was just called VBScript (Virus-Builder-Script) before.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Okay so I have a client who needs me to build an email template that every week it will be sent out as weekly stock alerts.
Can somebody help point me in the right direction? Maybe help me get started on this. Usually once I get started on something I get rolling fast. Right now I can't think of how this would all work out.
Here is the information she gave me:
In the email template we need:
· 5 frames: A,B,C,D,E
· 1 field to add name of the stock
· 2 of the frames (D,E) we need to be able to insert jpg’s into the frame
· We need multiple set ups to be added randomly (2 trades today, one yesterday, four tomorrow)
· We need to be able to track our results as shown.
· All you need to create is the ability for this spread sheet to have import capabilities.
In a previous email she said this:
We need:
1. Frame 1: our logo header
2. Frame 2: date and details
3. Frame 3: the stock chart (we’ll cut and paste the actual chart into the frame
4. Current Recommendations – excel spreadsheet feed
5. Previous Recommendations - same – we need this to update with live information. I have no idea how this works. Do you?
Here is the picture that was in the email that helps illustrate what exactly she wants.
http://i227.photobucket.com/albums/dd151/0vermind7/info.png
Hopefully somebody can point me into the right direction with this. I was thinking of doing PHP but would that work right? And how might I be able to get live information from the stocks? I figure I might have to do Google's Stock API?
Any help and suggestions be great!!
Thanks guys!
-Mike
|
|
|
|
|
|
Hi, maybe someone has some input on this.
I've been puttering around trying to set up a menu on the left side of my webpage that will load pages into the wider right side when the links are clicked.
I've tried frames, but there seems to be a problem with my server.
I've tried using <divs> for this, and downloading some ready made menu-generation programs that create a lot of Javascript, where the code is inaccessible, but evertying is too complex and doesn't give results, when place in my Linux-based hosting account.
Now I'm sort of wallowing in PHP, not making much headway.
Does anyone have experience regarding the simplest way to code this conceptual script, without Frames?:
1. Code for menu button with an anchor to a page on same server, located on left of webpage.
2. Code that when clicked, loads page into right side.
Thanks in advance
Shakhar
TIKKUNIM
It's never too late to change
|
|
|
|
|
Save yourself a lot of hassle and use some existing software like WordPress or Drupal.
Try to ignore anything to do with frames or thinking in terms of you click in a menu and the right side of the page loads. Clicking on a menu can simply load another page with the same menu displayed - this is how the majority of websites work (such as here at CodeProject) and it doesn't have any of the problems associated with frames.
|
|
|
|
|
Thanks. Can you give me a few tips, about how this new paradigm works?
I'm now working on a website that I am gradually building up, so the menu gradually expands as I put in more pages, and this will continue indefinitely. In such a dynamically evolving situation, how would you go about setting up a workflow based on having the menu on every page?
Thank in advance
Shakhar
TIKKUNIM
It's never too late to change
|
|
|
|
|
If you're using PHP, I'd recommend placing the code for the menu in a separate file, then including this in each of your pages using the include() function - then you can just change the central menu file and all changes will be reflected in each individual page that contains it.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Thanks, I've started looking into PHP. However, its seems I have a sharp learning curve ahead of me, cause I don't know the faintest about PHP. Yet.
However, the question now is, which is the steeper learning curve: learning enough PHP to create this navigation, or taking the above advice and going into a CMS like Wordpress or Drupal?
I've only gone into website building because I wanted to get some content across, and I've been wasting virtually weeks, boning up on HTML, web-design, website hosting and now PHP, just to start off, and its seems the ocean is just getting deeper...
Appreciate any advice...
Shakhar
TIKKUNIM
It's never too late to change
|
|
|
|
|
How Can i View A Table Content in a Mobile web Page Like GridView in WebSite?
|
|
|
|
|