|
This is the asp.net forum. I think you meant to post this elsewhere.
I didn't get any requirements for the signature
|
|
|
|
|
marjanaprifti wrote: am a 100 pc network adminstrator. i want to safe soem paper and tone so i was thinking to implement a solution to that; force print preview option before printing on all types of documents. i saw posted the "PrintPreview_scr" code but i don't know how to adopt it to my domain users.
How does it related to ASP.NET ?
|
|
|
|
|
Hi all,
Is it possible to get access to a query string when its hidden from view? Google's query string would be easy to do as you can capture the value of 'q' from the string, change it then set it away searching as its visible.
It doesn't matter to the application that the user can't see (or does not need to see) the query string but how can I capture it, manipulate it behind the scenes than pass it to be processed?
Cheers
Scott
|
|
|
|
|
You can use hidden variables.
You can also use context variable with Server.Transfer method for moving one page to another.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks for that, didn't know you could do that.
Will that also grant access to the query string as well? Will need to see it to extract the parameter names from the query string?
|
|
|
|
|
Hello
can we hide any column into grid view where we can store any id of particular item which can be use for further operation
plz any one guide me
if any body has its samples solution plz give ge
|
|
|
|
|
instead of storing it in any column and hiding it you can use datakeys.....
sample code:
//in RowEditing event
int row = e.NewEditIndex;
string id = GridView1.DataKeys[row][0].ToString();
|
|
|
|
|
If I understand your question correctly, wouldn't setting the columns Visible property to false provide you with the solution you seek (Visible="false" ). This is a very common technique.
Regards,
Gary
|
|
|
|
|
Hi...
here i have send mail with attachment file.
i have used stream class for sending attachment.
Here is code......
public bool SendMailToExternalUser(string strToEmail, string strbody, string strSubject, string strFileName, Stream FileStream,bool bCheck)
{
bResult = false;
MailAddress from = new MailAddress(Config.MailFrom);
MailAddress to = new MailAddress(strToEmail);
MailMessage mail = new MailMessage(from, to);
mail.Subject = strSubject;
mail.Body = strbody;
mail.IsBodyHtml = true;
mail.Sender = from;
Attachment attachFile = new Attachment(FileStream, strFileName);
mail.Attachments.Add(attachFile);
if (bCheck == true)
{
SmtpClient SmtpMail = new SmtpClient(Config.MailServerSmtp);
SmtpMail.Send(mail);
bResult = true;
}
bResult = true;
}
this works fine when there is only one file to attach.
but if i want to attach multiple files then it overwrite to first file with second.
how can i get more then one file in FileStream?
kindly help to solvethis issue.
Thanks.
Regards,
PUJA FALDU
|
|
|
|
|
pujafaldu wrote: but if i want to attach multiple files then it overwrite to first file with second.
How are you attaching multple files?
The code only seems to work as far as there is one attachment.
In fact your method should look like:
public bool SendMailToExternalUser(string strToEmail, string strbody, string strSubject, List<string> PlstFileNames, List<Stream> PlstStreams)
{
MailAddress from = new MailAddress(Config.MailFrom);
MailAddress to = new MailAddress(strToEmail);
MailMessage mail = new MailMessage(from, to);
mail.Subject = strSubject;
mail.Body = strbody;
mail.IsBodyHtml = true;
mail.Sender = from;
for(int LiCount = 0; LiCount < PlstFileNames.Count; LiCount++)
{
Attachment attachFile = new Attachment(PlstStreams[LiCount], PlstFileNames[LiCount]);
mail.Attachments.Add(attachFile);
}
SmtpClient SmtpMail = new SmtpClient(Config.MailServerSmtp);
SmtpMail.Send(mail);
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
my question is here!
List<stream> PlstStreams , how can i create group of stream for multiple files.
i have code for stream in another file which pass above values.
string strAttach = string.Empty;
string strSendAttach = string.Empty;
string strFileName = string.Empty;
string strFileAttachment = string.Empty;
Stream FileStream;
bool bFlag = false;
bool bCheck = false;
HttpFileCollection hfc = Request.Files;
if (hfc.Count != 0)
{
for (int i = 0; i < hfc.Count; i++)
{
if (!string.IsNullOrEmpty(hfc[i].FileName))
{
FileStream = hfc[i].InputStream;
strFileAttachment = hfc[i].FileName;
if (objMailSend.SendMailToExternalUser(ValidetEmailId, txtMailBody.Text, lblSubject.Text, strFileAttachment, FileStream, bCheck))
{
lblMessage.Visible = true;
lblMessage.Text = "Mail has been sent successfully.";
lblMessage.CssClass = "succLabel";
}
}
}
}
Thanks.
Regards,
PUJA FALDU
|
|
|
|
|
May be you can do this:
string strAttach = string.Empty;
string strSendAttach = string.Empty;
string strFileName = string.Empty;
string strFileAttachment = string.Empty;
Stream FileStream;
bool bFlag = false;
bool bCheck = false;
HttpFileCollection hfc = Request.Files;
objMailSend.SendMailToExternalUser(ValidetEmailId, txtMailBody.Text, lblSubject.Text, hfc);
public void SendMailToExternalUser(string strToEmail, string strbody, string strSubject, HttpFileCollection PobjFileCollection)
{
MailAddress from = new MailAddress(Config.MailFrom);
MailAddress to = new MailAddress(strToEmail);
MailMessage mail = new MailMessage(from, to);
mail.Subject = strSubject;
mail.Body = strbody;
mail.IsBodyHtml = true;
mail.Sender = from;
for(int LiCount = 0; LiCount < PobjFileCollection.Count; LiCount++)
{
Attachment attachFile = new Attachment(PobjFileCollection[LiCount].InputStream, PobjFileCollection[LiCount].FileName);
mail.Attachments.Add(attachFile);
}
SmtpClient SmtpMail = new SmtpClient(Config.MailServerSmtp);
SmtpMail.Send(mail);
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hey....
Lots of Thanks..........................
as ur suggestion ,i have made changes and it works fine..
Regards,
PUJA FALDU
|
|
|
|
|
I realize this doesn't answer your code-specific question, but is zipping the files an option? It will provide better speed and reliably, and limit your attachments to a single file. You can use the System.IO.Compression class to compress the stream of files. Advantages of zipping files for email: Zip or unzip a file[^]
Regards,
Gary
|
|
|
|
|
Hi I am a c++ programmer new to ASP.NET, I am using VS 2005
I want to create a Web Form with 2 or 3 fields with save button, which can insert a
record in the ORACLE table.
Please advice good links or resource
|
|
|
|
|
Have a look here[^] for straight solution.
For more learning, this [^]would be nice.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
There are lots of samples available when you google....
|
|
|
|
|
|
Hi
Is there a way to display a DIV object on top of an ActiveX control.
I'm using Office web components and I need to display a menu bar which should be displayed on top of these(owc) controls.
Help ?
|
|
|
|
|
Did try it some ages ago, never managed to do anything with z-index, only solution was to use JavaScript to hide activex, and show it back again when div hides.
Objects have infinite z-index, this is why you can put as large z-index to div as you want, but it will not be on top.
What comes to my mind is iframe, did never try it, but, iframe is sort of an object also. Maybe you could try to change your div to iframe and see if it gets on top of activex.
|
|
|
|
|
Hi,
I am using FCK Editor in my WebPage, The content of web page is retrived from sql table,i need to edit the content and update the text in table using FCK editor. Once i edit the text(change the font color,bold the text etc) and try to update in sql table i got the below error(due to HTML tags like "strong" etc)
"A potentially dangerous request.form value was detected from the client"
I need some help to save the formatted text to sql table using FCK Editor
|
|
|
|
|
You probably need to turn off the checking that is causing that message to appear. If you have those tags in your control, I doubt there's a way around it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Or because of security reasons, better not disable checking but instead encode
data he sends.
oFCKeditor.Config['HtmlEncodeOutput']=true;
But if he did try to google it he would have found this out.
Edit:
It's funny how all this kind of posts come from India.
|
|
|
|
|
OK, I've never used the control, I assumed he'd read the docs and had no options.
Enver Maroshi wrote: It's funny how all this kind of posts come from India.
Tell me about it, did you see the guy asking over and over how to remove a printer from a list, below ? On the other hand, some of the best programmers I know, are Indian. They are not, however, in India.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yes, but i think it's got nothing to do with country they are from, maybe it's only that in India there is really a lot of people that try to be programmers, but they are missing basics, either this people did not learn to programm at all, or they did not pay attention in school. I understand this is forum for helping people, but this are basic question, like someone would ask how to write a code that will print out "yes" or "no" depending on boolean input. This people are missing basics, and they still manage to make real applications, they are copy-paste Gods
Company in which i work did work with people from India, and they ware really good (flash) programmers. So, i guess it's individuals, and i think the problem is that all good programmers from India go in states or europe, and the new guys don't have anyone that will teach them. So they try to learn from internet, and the result we can see.
I think one learns most from they coworkers.
|
|
|
|