|
Hey how is everyone doing today? This is a ASP VBS question, I wasnt sure if I should post in here or in the visual basic forum so I apologize if this is the wrong place for this question.
I am trying to create a asp page that will take the text from an input and for each letter change it into a specified image. I am creating a generator so I can make a ton of animated letter images and they will be displayed instead of regular text depending on what the user enters.
Here is what I have tried already. The problem is, it replaces the c's in the "b" <img src string so it wont display the "b" image.
I know this is because it replaces the B with the img src and then the C replaces everything in it, what I want to know how can I get it to just replace what was inputed and not what gets replaced after it is submitted you know? haha that may sound confusing if you dont know what Im saying I will try to better explain.
Thanks for the help.
<%
sGlitter = Request.Form("text")
Function Glitter(sGlitter)
sGlitter = Replace(sGlitter, "b", "<img src=http://www.icecandyeffects.com/glitter2/pink1/b.gif>")
sGlitter = Replace(sGlitter, "c", "<img src=http://www.icecandyeffects.com/glitter2/pink1/c.gif>")
Glitter = sGlitter
End Function
Response.Write Glitter(sGlitter)
%>
|
|
|
|
|
icecandy wrote: question, I wasnt sure if I should post in here or in the visual basic forum so I apologize if this is the wrong place for this question.
Neither. Outdated and dead web technologies belong in the web development forum.
Why on earth would you use ASP ? Do you hate yourself ? ASP was a nightmare.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
So does each letter have a unique image then? I would build your image string separately and not use Replace. I'm not a VB coder so here's some pseudo code:
<br />
sGlitter = Request.Form("text")<br />
imageString = ""<br />
<br />
For Each Letter ltr in sGlitter<br />
imageString = imageString & "<img src=http://www.icecandyeffects.com/glitter2/pink1/" & ltr & ".gif>"<br />
End For<br />
Sorry for the inexact code, but you get the idea???
|
|
|
|
|
I am dynamically displaying thumbnail images from a folder but under each image, I have a checkbox -this is so the user can click a checkbox for each image he/she wants to delete and then click the submit button. However, I know I can get the values of checkboxes checked (true/false) but I need the filename of the image above it so I know which image to delete. I tried assigning the filename to the id of each checkbox but I get the error:
"The ID property of a control can only be set using the ID attribute in the tag and a simple value."
My code is as follows:
<form id="form1" runat="server">
<div>
<asp:DataList ID="dlImages" runat="server" forecolor="#000000" backcolor="#ffffff" cellpadding="3" gridlines="none" width="50%">
<itemstyle font-name="tahoma,arial,sans-serif" font-size="12" backcolor="#ffffff" />
<alternatingitemstyle font-name="tahoma,arial,sans-serif" font-size="2" backcolor="#ffff00" />
<itemtemplate>
<img src="uploaded/<%# Container.DataItem %>" border="0" />
<asp:CheckBox ID="<%# Container.DataItem %>" Text="<%# Container.DataItem %>" Name="<%# Container.DataItem %>" runat="server" />
</itemtemplate>
</asp:DataList>
<input id="btnDelete" type="button" value="Delete" OnServerClick="deletePics" runat="server" />
<asp:Button ID="btnCancel" runat="server" onclick="btn_Cancel_Click"
Text="Back to Vehicles" CausesValidation="False" />
</div>
</form>
and I am binding an ArrayList of filenames on Page_Load.
Any ideas would be much appreciated.
Thanks
Lorna
|
|
|
|
|
Yes, the id can't be that complex. If your images come from a DB, use the id of the DB item.
One way or the other, you need to come up with a list of simpler values that map to your images, and use those.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks but I'm just navigating through a directory and adding each filename to an ArrayList, I then bind the list to the DataList so somehow need to get the filename. I tried assigning the filename to the Name property using Name="<%# Container.DataItem %>" but when I wiew the source I get: name="dlImages$ctl09$cb3"??
So any ideas would be appreciated.
|
|
|
|
|
Are the filenames unique ? If you use Path.GetFileName, will that be unique enough ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Try Giving Id a Fixed Value Like chk1 ,and bound name and text with arraylist
|
|
|
|
|
Hi All,
I'm having a problem with a gridview that I am dynamically creating with my code behind. I have a multiline textbox for users to input data that is then displayed in the gridview. When the gridview databinds with the table, it is not displaying the new lines. I've found a lot of articles online showing how to fix this by setting HTMLEncode = "false", however because I'm not using any bound fields I don't think that applies for this situation. I'm thinking I might be able to resolve this by catching the text being read in from the file during the databind and doing a Text.Replace(Environment.NewLine, " ") which would display them correctly in the cells without actually modifying the saved text in my saved file on the server.
GridView gv1 = new GridView();
gv1.Width = 600;
gv1.DataSource = Table1;
gv1.DataBind();
gv1.HeaderRow.Height = 50;
gv1.HeaderRow.BackColor = System.Drawing.Color.Black;
gv1.HeaderRow.ForeColor = System.Drawing.Color.White;
gv1.RowStyle.Height = 100;
Can someone give me a quick example of how I could wire this up in the code behind?
Thanks!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
I'd imagine an onitemdatabound event handler, and you'd find the textbox in each row and replace the NewLine with a br tag.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hey Christian,
I really like your Quote "Driven to the arms of OSX by Vista". I'm about to that point myself using Vista x64, however I might go for one of the Linux flavors
Do you have an example of how I would find the textbox in each row? I'm creating the gridview dynamically because the columns will change depending on the date each week.
GridView gv1 = new GridView();
gv1.Width = 600;
gv1.DataSource = Table1;
gv1.DataBind();
gv1.HeaderRow.Height = 50;
gv1.HeaderRow.BackColor = System.Drawing.Color.Black;
gv1.HeaderRow.ForeColor = System.Drawing.Color.White;
gv1.RowStyle.Height = 100;
GridView gv2 = new GridView();
gv2.Width = 780;
gv2.DataSource = Table2;
gv2.DataBind();
switch (DateTime.Today.DayOfWeek.ToString())
{
case "Monday":
gv2.Rows[0].Cells[0].BackColor = System.Drawing.Color.Aqua;
break;
case "Tuesday":
gv2.Rows[0].Cells[1].BackColor = System.Drawing.Color.Aqua;
break;
case "Wednesday":
gv2.Rows[0].Cells[2].BackColor = System.Drawing.Color.Aqua;
break;
case "Thursday":
gv2.Rows[0].Cells[3].BackColor = System.Drawing.Color.Aqua;
break;
case "Friday":
gv2.Rows[0].Cells[4].BackColor = System.Drawing.Color.Aqua;
break;
}
gv2.HeaderRow.Height = 50;
gv2.HeaderRow.BackColor = System.Drawing.Color.Black;
gv2.HeaderRow.ForeColor = System.Drawing.Color.White;
gv2.RowStyle.Height = 175;
GridView gv3 = new GridView();
gv3.Width = 600;
gv3.DataSource = Table3;
gv3.DataBind();
gv3.HeaderRow.Height = 50;
gv3.HeaderRow.BackColor = System.Drawing.Color.Black;
gv3.HeaderRow.ForeColor = System.Drawing.Color.White;
gv3.RowStyle.Height = 100;
Panel1.Controls.Add(gv1);
Panel1.Controls.Add(gv2);
Panel1.Controls.Add(gv3);
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
I am using Address control in my page which consists of
Country, state, County all are drop down lists and City, addresslines are regular text controls.
When ever i change index of Country or state or county focus is being set to the first control of the page.
Can anyone please let me know if there is anyway to set focus on the controls it self even after postback.
cheers
chandu
|
|
|
|
|
Inject javascript to set the focus on the right control after the page loads.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
I don't see how this is an ASP.NET question.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have 2 projects in two different solutions. one is a class kibrary being used as a rerference to another project. In this case how to debug class library
|
|
|
|
|
You need to make them part of the same solution, I would have thought. Or, you can take the VS instance that has the dll code, and attach it to the ASP.NET process, and put some breakpoints in, that should work.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
my setup using domain pointing
say Myabc.com points to a folder in the Home directory say /MSI
Using expression web I can upload the site without issue which has a web.Sitemap
this all seems to work correctly in the with the tree navigation ties to this file.However, the sitemappath nav bar does not work and as best I can figure it needs something in the web.config file which I can't figure out.
|
|
|
|
|
Does it work on your local machine ? You're not giving us much to work with here....
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
can any one help in getting answer to this question. while browsing a ASP.NET application, a request is sent from browser to web server and web server processes the request and sents the required html to the browser which will be displayed in client's browser. But at the end there is only HTML that's there with client's browser. This HTML can't execute code in server. Then how does the events in ASP.NET execute
|
|
|
|
|
Viewstate. There's a block inside your HTML that contains encoded information, which maps to your controls on the page. Then when you click a button, an event is sent in the post back to the server. This information is then matched to the control tree ( which means that dynamically created controls can fail to have events b/c they are not in the tree soon enough ), and thus the framework can work out which control caused the postback, and if it has a method that needs to be called.
I have a book here somewhere, it has a relatively harmless title like 'programing ASP.NET in C#', but in fact, it goes through the behind the scenes stuff really well, I'd recommend it, if I could find it to give you the title....
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
To cut a long story short, I need to develop a web application for use on my company's intranet that will be used to calculate rebates that our customers have earnt.
The app needs to be able to pull customer details from one database, and have the possibility to group them together, and assign the group its own details. It then needs to be able to pull these customers' sales figures from another database to calculate total sales, and based on these figures, to calculate how much the customer, or group of customers, has earned in way of rebate. The figure of the rebate will be calculated by the variables of which scheme the customer is assigned to. The app needs to be able to create and modify the schemes that a customer can be assigned to.
I have the connections to the relevant databases in my Visual Studio project, and dropped the relevant objects on the page, but I have no ability to code the application, and this is where I need help. Is there anyone who would be willing to help me, step-by-step, page-by-page, go through the coding with me? I understand the technology of ASP.NET as I have completed a course some time ago, but I have never been able to do any coding and this is where I need help.
If you need ANY more information at all, please ask, and I will be happy to give it to you.
Sorry for the long post....
Desperately,
Jay
|
|
|
|
|
There's a jobs board on Code Project now. If you're not willing to try to code it yourself, this forum can't help you, you need to pay for a job ad and hire someone.
It's probably cheaper to buy a book on ASP.NET and work through it. I assume you didn't do a programming course, if you don't know how to code. If you do that, you can ask questions here as you get stuck.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Can someone point me to info on what's involved in setting up our server to host a simple ASP.Net site? Google returns plenty of hits on where to go to host. We have a sever in house we want to use.
Thanks.
Everything makes sense in someone's mind
|
|
|
|
|
You install ASP.NET AFTER you install IIS, then you point IIS to the root folder. Simple.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|