|
|
If you want to stop a postback, return 'false' on the client side event. Of course, if you stop postback, then your server side code won't run. If you want the server side code to run without any sort of postback, not even AJAX, then you are seriously deluded and need to give up until you've read some basic books, that would make your question retarded. If you want to stop the server side code from running based on a condition in the client side code, just return false to stop the postback.
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
|
|
|
|
|
hi
in javascript validation function
write return false
so it stops the page excution
|
|
|
|
|
I am using this code to find the value of dynamically created controls
Dim cmd2 As String = ("Select Specification from DefineSpecification where CategoryID=" + id.ToString())
Dim rdr2 As IDataReader = db.ExecuteReader(CommandType.Text, cmd2)
Dim conn As New SqlConnection
Dim cmd As New SqlCommand("Select Count(*) from DefineSpecification Where CategoryID=" + id.ToString(), conn)
conn.ConnectionString = ConfigurationManager.ConnectionStrings("See2Buy").ConnectionString
conn.Open()
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
While rdr2.Read
Dim lbl = New Label()
lbl.Width = "140"
lbl.Text = rdr2.Item("Specification")
For counter2 As Integer = 0 To count - count
Dim txtbox As TextBox = DirectCast(Panel4.FindControl("TextBoxID1"), TextBox)
Dim cmd3 As String = "Insert into Specification(CategoryID,ProductName,SpecificationHeading,SpecificationDescription)Values(" & id & ",'" + txtProductName.Text + "','" + lbl.Text + "','" + txtbox.Text + "')"
Dim dbcmd3 As DbCommand = db.GetSqlStringCommand(cmd3)
db.ExecuteNonQuery(dbcmd3)
Next
End While
The error is :Object reference not set to an instance of an object.
|
|
|
|
|
KhandelwalA wrote: Object reference not set to an instance of an object.
The meaning of this error is that an object which you are using is not initialized i.e. it is NULL(Nothing is VB.Net).
Most likely, it looks to me that rdr2 might me NULL in some cases.
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.
|
|
|
|
|
Because your code sucks. In SO many ways, but in this instance, because it grabs all sorts of items and doesn't ever check for success before using them
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
|
|
|
|
|
Christian Graus wrote: Because your code sucks
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.
|
|
|
|
|
When I tried to open the file's which may be .doc or excel or any type of file I got the following error "Thread was being aborted..." in the below line of code
Response.Redirect( @"Documents/" + strFileName);------------------------------------------------------------------
First I read the file and saved the data into the database in a binary field
The below lines of code I have used for open the page
try
{
string strFileName = string.Empty;
objTarget.EmpNumaber = empID;
objTarget.DocName = documentName;
SqlDataReader sqlDr = objTarget.AppraiseeDetails();
while (sqlDr.Read())
{
strFileName = sqlDr["DocumentName"].ToString();
//Read binary Data into Bytes Array
byte[] fileBytes = (byte[])sqlDr["Document"];
//Create FileStream Object from for saving file
FileStream oFileStream = new FileStream(Server.MapPath("Documents") + @"\" + strFileName, FileMode.Create);
//SaveFile
oFileStream.Write(fileBytes, 0, fileBytes.Length);
//Dispose the memory of used objects
//Response.Flush();
oFileStream.Flush();
oFileStream.Close();
fileBytes = null;
}
//Close Reader and Connection
sqlDr.Close();
if (strFileName != string.Empty)
{
Response.Redirect( @"Documents/" + strFileName); }
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
I can't able to find out the issue why this Thread was being abortd error message.Please look into the issue and let me know a solution
with regards
Difin Mathew
|
|
|
|
|
Difink wrote: Response.Redirect( @"Documents/" + strFileName);
Should be like this:
Response.Redirect(@"~/Documents/" + strFileName);
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 the reply
Sorry still I got the same error "Thread was being aborted.."
My file path is
C:\Inetpub\wwwroot\PMPVKL\PMP\Documents\
I was tried this also
Response.Redirect(@"~/~/Documents/" + strFileName).
But got the same error
please advise me
Thanks
Difin
|
|
|
|
|
Are you using threads anywhere ?
Difink wrote: Response.Redirect(@"~/~/Documents/" + strFileName).
That is insane, why would you even try that ? I can only think because you're trying things at random. Do you know what ~ does ?
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
|
|
|
|
|
Do you have any other suggestion for the above issue?
|
|
|
|
|
if client don't have font that exist on server . So how to display that information on client with that font .
Sorry for my english !
modified on Monday, July 6, 2009 6:46 AM
|
|
|
|
|
There is a free tool from Microsoft called WEFT 3.2 (Microsoft Web Embedding Fonts Tool).
Microsoft has a web page devoted to this topic...
http://www.microsoft.com/typography/...ame=%20&fsize=
Download link:
http://download.microsoft.com/downlo...WEFTIII2b1.exe
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.
|
|
|
|
|
Hi,
Currently we are sending the e-mail using net.mail instead can we have our own email template with images and just modify the dynamic data and can send that email?
Thanks,
S.N.Prasad
S.N.Prasad
|
|
|
|
|
Whats the problem?
Create a Bodytemplate with some tokens (for eg ##yourname##) and replace these with the actual data while sending the email.
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 the reply!...
i had used same concept for filling the dynamic data in the template
##Url##"
##Title##
and by using this concept able to send the emails
(in the email)
but images are not getting shown/displayed
So plz suggest me what change i need to make in my template
Thanks,
S.N.Prasad
|
|
|
|
|
I'm able to send the email and
the problem is
image is not getting displayed in the email
How to solve this issue
Please help me for this!.
Please reply me as soon as possible
Thanks,
S.N.Prasad
|
|
|
|
|
I created n number of textboxes dynamically depends on user requirements.....now i want to save data of those dynamically created textboxes.....i m not getting the proper way whether to use FindControl or ViewState ?...........plz guide me
|
|
|
|
|
Hi,
You can use FindControl to get the value from dynamically created controls.
Best Regards
Jay
|
|
|
|
|
KhandelwalA wrote: ...now i want to save data of those dynamically created textboxes.....i m not getting the proper way whether to use FindControl or ViewState ?.
For Dynamically created TextBox, You need to keep in mind some point !
You have to create the Textbox Before Page Load . Create your text box in Page_PreInit() , otherwise, you will never get the ViewState and Postback Data. Because Postback data and View state data loads just before the Page_Load .
Hope this will help you !
|
|
|
|
|
Hello,
Hii everybody,
i want to know how to get live video stream from our web-cam in to our web-page
in asp.net ?
thanx in advance!
|
|
|
|
|
|
Hi guys! I am developing a page that gets a PFD file from a FTP directory and then reads it using the IO stream and then output it to the use in the same page.
I have built the page, but I am getting an error everytime I try it that says "there was an error reading this document".
Well, this is the code I am using:
Const username As String = "pdfuser"
Const password As String = "pdfpass"
Dim URI As String = "ftp://192.168.20.10/PDF/9006.pdf"
Dim ftpReq As FtpWebRequest = DirectCast(System.Net.WebRequest.Create(URI), FtpWebRequest)
ftpReq.Credentials = New NetworkCredential(username, password)
ftpReq.UsePassive = False
ftpReq.UseBinary = True
ftpReq.Method = WebRequestMethods.Ftp.DownloadFile
Dim ftpRes As FtpWebResponse = DirectCast(ftpReq.GetResponse, FtpWebResponse)
Dim responseStream As IO.Stream = ftpRes.GetResponseStream
'loop to read & write to file
Response.ContentType = "Application/pdf"
Dim FileSize As Long
FileSize = 1024
Dim Buffer(CInt(FileSize)) As Byte
Dim count As Integer = 0
Do
count = responseStream.Read(Buffer, 0, Buffer.Length)
Response.BinaryWrite(Buffer)
Response.Flush()
Loop Until count = 0 'see Note(1)
Response.End()
Please help..
Abdulsalam Alasaadi
Multimedia & Web Spacialist
http://www.zeroonebahrain.com
|
|
|
|
|
I want to display a pdf document on an Iframe and what gets displayed on my frame is :
"Server Error in '/LearningConceptsA' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /LearningConceptsA/Images/Variable[1].pdf
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 "
Have I placed it in the right folder? may be not. someone suggested I place it in the App_Code folder, which I can't see.
Well the code behind the dropdownlist looks like:
"protected void ddlBasicConcept_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlBasicConcept.SelectedValue.Equals("Variable"))
{
frmWord.Attributes.Add("src", "Images/Variable[1].pdf");"
Please help a junior programmer in need.
ML Lingwati
|
|
|
|