|
Nice homework assignment. First year, I see.
Is this JavaScript (as in title) or VB.NET (as in this forum).
|
|
|
|
|
Try this javascript function. This might be helpful.
function ChangeToCurrency (TargetString)
{
var Index;
if ((Index = TargetString.indexOf(".")) == -1)
TargetString += ".00"
else if (TargetString.substr(Index + 1).length == 0)
TargetString += "00"
else if (TargetString.substr(Index + 1).length == 1)
TargetString += "0"
return (TargetString);
}
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
I have
<%@ Register TagPrefix="spm" Namespace="SolpartWebControls" Assembly="SolpartWebControls" %>
and
<spm:solpartmenu ...(options go here)... />
In my Bin folder is the SolpartWebControls.dll that this is referring to.
It all works great but I have a red line under solpartmenu and says "Element 'solpartmenu' is not a known element. This can occur if there is a compilation error in the Web site." and if I go to Design view I get "Error Rendering Control - PageTable An unhandled exception has occurred. Request is not available in this context". I normally wouldn't care but this is on a master page so all pages using is can't be viewed in design mode. I have very basic users that will be creating the other pages and if they can't use Design more then they can't create their pages.
Any help would be great, thanks.
|
|
|
|
|
I have a form that has 2 sections.
Each section has a textbox/ fileupload control and a button.
I want to add a RequiredFieldValidator for the textbox/ fileupload control and want to activate the validator only to the controls in that section, when the button in that section is clicked.
When Button1 is clicked, then RequiredFieldValidator for textbox1 in section1 should get activated and not the RequiredFieldValidator of the control textbox2.
How do I do it?
Thanks
Krutika
|
|
|
|
|
|
If this is in .NET 2.0, you can use the ValidationGroup property. If not, you will have to do you validation on the server side.
|
|
|
|
|
What the advantages of one over the other when I'm programing a page? I understand that when the page is run it will change all the asp:Table, asp:TableRow, and asp:TableCell into their HTML counterparts so why not just use the counter parts? I understand most of the other asp:components and why they are better but I can't find a reason for asp:Table.
So far I've noticed:
I can't use Height and Width on the CSS versions
I can't edit my cell contents in Design View
I can't set a background image on the fly (I currently am using a CSS file but it seems a waste since all it has in it is repeating backgrounds and each class is only used once)
Please tell me what I'm missing, what advantages I could gain, or if I should just start using the basic HTML table.
Thanks for any help.
|
|
|
|
|
The advantage is runat="server", which of course treats it as any other serve control to use, and abuse, as necessary with your code behide.
I don't understand the problems you are having with CSS, it is applied on the client side after the control has been rendered to appropriate HTML.
only two letters away from being an asset
|
|
|
|
|
The CSS issues aren't that big of deal but why can I edit my cell contents in design view?
|
|
|
|
|
Goal of the filewatcher window service: to look in a folder named ‘Watcher’ for a particular type of file. Whenever a new file arrives in the watcher folder, service should pick up the file, read contents, then delete the file from the folder and move it in another folder named ‘Processed’.
I am using filewatcher’s oncreated event for this. Whenever a file arrives, the oncreated event is fired. The problem I am facing is that the service is not able to read the file. The exception received is: The process cannot access the file
'\\WATCHER\abc_1959537.xml' because it is being used by another process. I tried to manually paste the files in ‘Watcher’ folder as well as in automated manner by a console application the result is same. Please help!
I m using this code:
private void filewatcher1_Created(object sender, System.IO.FileSystemEventArgs e)
{
log.Info("file found :" + e.FullPath);
try
{
//Get the path of the recently arrived file
string fpath = e.FullPath;
//Get the xml string from file
FileStream objStream= new FileStream(filename, FileMode.Open,FileAccess.Read,FileShare.Read);
StreamReader sr = new StreamReader(objStream);
string tempstring = "";
string filestring = "";
while ((tempstring = sr.ReadLine()) != null)
{
filestring += tempstring;
}
sr.Close();
sr.Dispose();
//Move file in a new folder
FileInfo fi = new FileInfo(e.FullPath);
fi.Directory.CreateSubdirectory("updated");
File.Copy(e.FullPath, fi.DirectoryName + "\\Updated\\" + fi.Name, true);
fi.Delete();
log.Info("File Sucessfuly moved: " + fpath);
}
catch (Exception ex)
{
log.Info(ex.Message);
}
}
|
|
|
|
|
try wrapping the part that you open your stream reader in a using block,
Check out here
Also reading your code, I'm not quite sure where you the variable FileName get's it's values from?
the code is quite messy could do with some tidying up, tyhat way you could probably find the bug!
I tried something like this and it works fine for me?
StringBuilder sbXML = new StringBuilder();<br />
string fPath = e.FullPath.ToString();<br />
using(FileStream fStream = new FileStream(fPath,FileMode.Open,FileAccess.Read,FileShare.Read))<br />
using(StreamReader sr = new StreamReader(fStream))<br />
{<br />
while( sr.Peek() > -1)<br />
{<br />
sbXML.Append(sr.ReadLine());<br />
}<br />
}<br />
<br />
FileInfo fi = new FileInfo(e.FullPath);<br />
fi.Directory.CreateSubdirectory("updated");<br />
File.Copy(e.FullPath, fi.DirectoryName + "\\Updated\\" + fi.Name, true);<br />
fi.Delete();<br />
<br />
|
|
|
|
|
Thanks for your suggestions; I tried with your code also but facing same problem. Sometime the service successes in reading, moving and deleting file but sometime it gives error "process cannot access the file 'abc_4726137.xml' because it is being used by another process".
|
|
|
|
|
sorry I was busy today!
Instead of
FileInfo fi = new FileInfo(e.FullPath);<br />
fi.Directory.CreateSubdirectory("updated");<br />
File.Copy(e.FullPath, fi.DirectoryName + "\\Updated\\" + fi.Name, true);<br />
fi.Delete();<br />
Why don't you try File.Move ?
|
|
|
|
|
Hi! i want whenever i click on an item of a datagrid, then border color of that item become blue on client side. please help me.
|
|
|
|
|
Hey Nigam Samir,
I believe I can help you...
Please Add the following code into the DataGrid ItemDataBound Event.
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes("onclick") = "javascript:this.bgColor='blue';"
End If
Have a happy programming...
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
Thanks Venkatesh.
This code change back ground color of particular item not border color of that item.
|
|
|
|
|
You can try out by using BorderColor in place of bgcolor.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Come on man... He is taking about JavaScript. "BorderColor" is not a attribute or style of a Table Row...
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
I NEED TO DEVELOP AN INTRANET BASED APPLICATION WITH FOLLWING REQUIREMENTS.
-EMAIL SERVER
-AUTO SMS DELIVERY ON USER ACCOUNT.
I HAVE COMPLETED THE EMAIL SERVER PART NOW I AM GETTING DIFFCULTY IN AUTO SMS DELIVERY
PLZ HELP ME TO SOLVE THIS PROBLEM
HOW COULD I DO IN ASP.NET.
I WANT TO CONNECT MY MOBILE AND SEND SMS FROM IT.
MIR IQBAL ALI
|
|
|
|
|
I think you should first of all, STOP TYPING UPPERCASE!!! This doesn't make us reply or type quicker!! Have you read some articles about sending sms messages from a computer? You need an SMS Server kind of construction which sends the messages via a modem line to you phone provider, which handles the message and actually sends the message in the air.
I think you should be able to send the message to you cellphone, en let it send the message but have no experience using that solution. It might also depend on the cellphone you're using (i can't send sms messages through my computer having a smartphone)
You should consider one of those SMS servers
|
|
|
|
|
Hello,
I have developed a Web service and a PDA application. The Web service and SQL database are on the same server.
The client will use the PDA application and access the web service to get data on customers.
The web service, PDA application, and SQL server have all be developed and are working using the localhost, local network. By adding the web reference.
My problem is when I want to add the web reference from the Internet. This is because the clients will be on the road or at a clients office. And will need access to their data.
I have added the web reference in the normal way. Right click | Add reference. From the Internet I can access the server and add the web reference. However, the problem is that wsdl file is never included.
Some tests i have done.
Test 1
Accessing the web service when adding the web reference from the local computer, or local network. The following files are included: reference.map, service.disco, service.wsdl.
Test 2
Access the web service from the Internet when adding the web reference.
The following files are included: reference.map, service.disco. THERE IS NO service.wsdl.
Test 3
If I access the web service directly from a browser, I can see the list of web methods and descriptions.
Test 4
If i acess the web service from the Internet when adding the web reference like the following: http://MyServer/service.asmx?wsdl. The only file that is included is the service.wsdl.
I have created another simple web service that just displays the hello world. This has the same problem as above, but maybe you can use it for testing my web service.
http://cf01.no-ip.com:8000/webservice1/service.asmx
However, the above link works, but sometimes is offline.
If you can give me any advice or help with this problem I would be most grateful,
Thanks in advance,
Steve
|
|
|
|
|
I'm working on an application where clients can upload files, but those files should be stored encrypted.
I am using a propietary uploader quite similar to asp.net uploader, and I was trying to encrypt the file to another folder and delete the original one.
To do the encryption tried using Rijndael as seen on: http://www.codeproject.com/dotnet/EncryptFile.asp[^]
The problem is that this article is reffered to a local application, so when I use System.IO.FileStream type on an URI address, it doesn't work.
I've been trying to use System.Net.WebClient namespace whithout much success.
Any clue on how I can proceed?
Thanks
|
|
|
|
|
Why don't you upload the file to the server and encrypt the file server side once uploaded?
|
|
|
|
|
That's what I meant.
I couldn't encrypt the file using URI file paths
Anyway I've solved the problem now. I use the real file path from inside the server, so there is no problem using fileStream.
|
|
|
|
|
That's exactly the way to do it, because else you would access the file via IIS which probably leaves you with lots of problems and most of all, not enough rights to manipulate the file.
|
|
|
|