|
Have you tried http://asp.net, they have lots of tutorials in the form of code and videos?
|
|
|
|
|
I have a web page that has a link for an attachment and that uses Javascript to popup a new window, and that new window has code in the code behind to allow the user to open/save an attachment. (It works this way because we have 3rd party software that stores all of our documents for this application).
Link (from the source):
<a href='javascript:RetrieveDocument(-9999998998)'>AnnouncementAttachment.txt</a>
Javascript:
var download_win;
function RetrieveDocument(id)
{
CloseDownload();
download_win = window.open('../Common/DocRetrieval.aspx?id=' + id,'attachment','width=1, height=1, top=0, left=0, toolbar=0, menubar=0, location=0, status=0, scrollbars=0, resizable=1');
window.onunload=CloseDownload;
}
function CloseDownload()
{
if(download_win != null)
{
download_win.close();
}
}
Code behind in DocRetrieval.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
string doc_id = Request.QueryString["id"];
//This part retrieves the document from the database
DataObjects.Document docs = new DataObjects.Document();
docs.EnforceConstraints = false;
DataObjects.Document.DocumentRow doc = docs._Document.NewDocumentRow();
doc.doc_id = long.Parse(doc_id);
docs._Document.AddDocumentRow(doc);
DataRequestChain.RequestBase req = DataRequestChain.RequestFactory.CreateRequest("GetDocument");
req.DataObject = docs;
req.ExecuteTran(); //the actual call to the db
if (!doc.Isdoc_nameNull())
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment; filename=" + doc.doc_name );
Response.AddHeader("Content-Length", doc.file.Length.ToString());
Response.ContentType = doc.content_type;
Response.BinaryWrite(doc.file);
Response.End();
}
}
Watin code in my test class:
ie = this._cpUi.CreditPlusIeWindow; //(already set up)
this._cpUi.Detail.Frame.Link(Find.ByText(FILE_NAME)).Click(); //This is the link for the attachment
cpUi.CatchPopupIEWithoutBaseUrl(docRetrievalURL, false); //This catches DocRetrieval.aspx and puts a pointer to it in cpUi
Assert.That(cpUi.CreditPlusIeWindow.Url.ToUpper().Contains(docRetrievalURL.ToUpper())); //Make sure we have our DocRetrieval page
//Handle the open/save file dialog
FileDownloadHandler dialogHandler = new FileDownloadHandler(FileDownloadOption.Open);
ie = cpUi.CreditPlusIeWindow;
WatiN.Core.DialogHandlers.FileDownloadHandler baseDialog = new WatiN.Core.DialogHandlers.FileDownloadHandler(FileDownloadOption.Open);
ie.DialogWatcher.Add(dialogHandler);
baseDialog.WaitUntilFileDownloadDialogIsHandled(15);
The WaitUntilFileDownloadDialogIsHandled doesn't do anything, it waits for 15 seconds and then throws an exception that it's not handled. The dialog that pops up immediately goes away, I'm not sure why, I would think the baseDialog was clicking the "ok" but that is not apparent in the few seconds that dialog is up, and a file will never open. I'm not sure how to use Watin to handle this. The whole point of the test is to make sure the attachment was stored correctly. I.e. we are able to open it from the original web page. Any help would be appreciated!! Thanks!
|
|
|
|
|
In my webform I have a search functionality with name or email. This options has been given using a radio button. A textbox is also provided for entering the name or email. Since this is a required field, a required field validator is given.
Also I need to validate the email, only if the user selects email radiobutton and enter the email id. I have the email validation expression which is working perfectly fine.
My problem is if he selects name and enters something in the textbox, then there is no need to trigger the email validation. So how can I do all this validations with a single text box.
Since the user needs to select either name or email, I want to have only one text box. Can anybody please provide any solution for this? Thanks for any help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Use a custom validator
Youll have to implement your logic with javascript to make it more user friendly
Alexei Rodriguez
|
|
|
|
|
hi everyone,
im a asp.net newibe and i have a question regarding a method of work.
my issue is as follow:
in my form i got some control that can be drag by a client.
the amount of controls is dynamic.
in the server i got an array that holds each control coordinates.
I captured the drag event in the client and i can keep the new coordinates in the client-side.
the problem is how do i update the coordinates array in the server without a postback????
saving them in a hidden parameter is a good idea in case you have a known amount of controls but if the number is unknown i need to create a hidden parameter for each control.
do you have any idea for an algorithm that could help me
|
|
|
|
|
shovaly wrote: the problem is how do i update the coordinates array in the server without a postback????
Of course you can't do anything on the server without communicating with the server. If you mean without posting the entire form then you are asking about using some form of Ajax or Remote Scripting. You can Google both of those things and find tons of information.
led mike
|
|
|
|
|
OK thanks,
but finally i used cookies in order to save the contorol coordinates
|
|
|
|
|
Is there a way to make a button that will make a specific pane show in an accordion?
Example:
I have 5 panes. In each one I would like a button that says Next. You click it and it automatically expands/goes to the next pane.
|
|
|
|
|
|
Are you saying use DIV instead of an accordion?
|
|
|
|
|
|
Ok.. so I guess you cant do the accordion thing? I was wanting to do that..
|
|
|
|
|
Hi,
I am using .net 2.0. I created a class file "condb.cs" in my website. I declared a variable in Globale.asax. I can access that value in first.aspx.cs page and i can't access that value in condb.cs file. Please help me to retrieve the global value in .cs file.
Thanks.
|
|
|
|
|
Why not to use application variables? like:
Application[key] = value;
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Hi,
Application variables can be used in aspx.cs files only. I have to access it in a separate .cs file. So, now I used HttpContext to access that global variable. If you know some other methods for that please refer me.
Thanks.
|
|
|
|
|
Application variables can be accessed in separate .cs files using:
HttpContext.Current.Application[key]
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Hi,
Thanks for your quick reply. I tried the method you have given. I got it right. Thanks.
|
|
|
|
|
Hallo,
I have a ajax modalpopupextender which pops up a panel for a button click. Every thing works fine
The popupcontrol panel has some controls, one of them is a label which is DynamicControlID for the popupextender.
I am rendering a radiobuttonlist dynamically. I am creating ListItems and adding them to Radiobuttonlist, and it is rendered.
Problem:
The text of some of the radiobuttons exceeds the panel width (i do not want to increase the width of panel). How to wrap the text of radiobutton, so that it can appear in a multiline.
For example after rendering the text is as below:
<table id="Table1" border=\"0\" style=\"font-size:Medium;width:40%;padding-top:24px;\">\r\n\t<tr>\r\n\t\t<td><input id=\"RadioButtonListCCList_0\" type=\"radio\" name=\"RadioButtonListCCList\" value=\"1316\" checked=\"checked\" /><label for=\"RadioButtonListCCList_0\">AR,AT,AU,BA,BG,BO,BR,BX,CA,CH,CL,CN,CO,CR,CU,CZ,DE,DK,DO,DZ,EC,EG,EM,ES,ET,FI,FR,GB,GR,GT,HN,HR,HU,ID,IE,IL,IN,IS,JP,KE,KR,MA,MX,MY,NO,NZ,PA,PE,PH,PL,PT,RO,RS,SE,SI,SK,TH,TN,TR,TW,US,VE,VN,ZA</label></td>\r\n\t</tr>\r\n</table>
Thanks for the help
|
|
|
|
|
Hi,
I am using vb.net and db2 database for my application. When I open attachments in my local webserver, the attachments are opening properly. But I am facing problem when I try to open same attachments in Test envoirnment, I am getting error message because datareader is not reading BLOB data from database.Its giving the BLOB of length zero.
It seems there is some problem with IIS settings. Please help me to solve this problem.
Note: Attachment data is saved in database.
Thanks in Advance
|
|
|
|
|
BLOB is binary data. I guess either IIS or Firewall puts restrictions on transferring data like that. You might wanna test it by disabling the firewall.
|
|
|
|
|
Hello guys
I have following function to get the list of email address from the database. When i pass this list to mail message BCC function in gives me the error which i have mentioned in subject. Please help me out
public void getEmailtoUsers()
{
DataTable getemailList = news.getEmailList();
foreach (DataRow objDr in getemailList.Rows)
{
emails += objDr["Email"].ToString() + ";";
}
emails = emails.Substring(0, (emails.Length - 1));
}
// email sending function
applicant.From = new MailAddress("support@supportimrankhan.org", "Support Imran Khan");
applicant.To.Add(new MailAddress("imran.hamid@supportimrankhan.org", "Imran Hamid"));
applicant.Bcc.Add(new MailAddress(emails));
|
|
|
|
|
<b>Hi dear friends,
I am using VS2005,i would like to know about that how to display the datagrid details in on page to an another page lable.
Thanks & With Regards,
M.S.Amirtharaj Vijay</b><b></b>
|
|
|
|
|
Can you explain again in English please.
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Please use proper subject.Describe your problem little bit more
Cheers!!
Brij
|
|
|
|
|
Better subject line and more clear inquiry may allow people to help you better.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|