|
Chetan many thanks for your help
That works in terms of loading 1 value but I have 5 buttons, depending on which one is clicked should load the relevant info in the textboxes on the 2nd form, I will have to create session variables for all these, do I have to use a select case to get this to work, any advice would be appreciated
Thanks again
SIMON GOUGH
|
|
|
|
|
helo all...,
i have make register and display in formview(insert mode) with usesqlsource1. when customer register a same userid, the error is
"Violation of PRIMARY KEY constraint 'PK_user'. Cannot insert duplicate key in object 'dbo.user'.
The statement has been terminated."
now i want to change that error, i put a errorlabel. i want errorlabel show "sorry, your id has been use.please use other id."
my code is:
Protected Sub SqlDataSource1_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Inserted
Dim label As Label = Me.FormView1.FindControl("label1")
If Not e.Exception Is Nothing Then
label.Text = "sorry, your id has been use.please use other id."
e.ExceptionHandled = True
End If
End Sub
the label is not show anything when i insert two same userid..
which is wrong?
plss.. help...
|
|
|
|
|
1. be sure that you can find control named label1 in FormView1
2. be sure label1 is visible = true (if exists in FormView1)
I Love SQL
|
|
|
|
|
thx for ur information...
but if i take that label outside formview, it can show errors.
but in formfiew, it seems hidden, although it visible is true..
i have use findcontrol("label1") to detect label, but it can not show too..
is there can not take in formview? must outside formview?
|
|
|
|
|
try to loop controls in formview1 in debug mode and be sure that label1 exists on formview1. if label1 exists it should displayed.
I Love SQL
|
|
|
|
|
Hi all...
I have a vcalendar (.vcs) file, which is actually an outlook meeting file which I contruct through StreamWriter in .net. I provide a link to download it, and it is downloaded perfectly in Internet Explorer. But when i try to download it in Firefox its content is opened in browser. I want a way to download it in Firefox as well.
Please note that this file can also be opened in a text Editors like MS word, wordpad, Excel etc etc...
Waiting for response.
Bye
|
|
|
|
|
Make sure you set the mime type of the file, IE probably works it out for itself.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can i define the mime type ..
Please give me the hint. for example if i use streamwriter to in a txt file, how can i define it as .txt. By the way i append .vcs in the link which downloads the file and also in the file appending "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN"
thx
-- modified at 10:18 Sunday 9th September, 2007
Bye
|
|
|
|
|
If you're sending the file with a response.Write, then the Response object is also used to set the MIME type. If you're not, how are you doing it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using the streamwriter to write the file.
In start....
l_strFilename = Server.MapPath("../../" + MZKBase._SysGenExcelFilePath + l_strGuid & ".VCS")
Dim l_oWriter As System.IO.StreamWriter = New System.IO.StreamWriter(l_strFilename)
l_oWriter.WriteLine("BEGIN:VCALENDAR")
l_oWriter.WriteLine("PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN")
l_oWriter.WriteLine("VERSION:1.0")
l_oWriter.WriteLine("BEGIN:VEVENT")
l_oDueDate = TimeZone.CurrentTimeZone.ToUniversalTime(l_oDueDate)
l_oString.Append("DTSTART:")
l_oString.Append(AppendZero(l_oDueDate.Year.ToString()))
...Rest of the File...
l_oWriter.WriteLine("PRIORITY:3")
l_oWriter.WriteLine("END:VEVENT")
l_oWriter.WriteLine("END:VCALENDAR")
l_oWriter.Close()
And in the end
l_oString = New Text.StringBuilder
l_oString.Append(" Save As ")
To show the link saveas...
Bye
|
|
|
|
|
OK, you're showing a link. In that case, there's nothing you can do. You'd have to have your link redirect to code that pushes the file down with the right MIME type ( which would be just to specific that it's a file for download ), to make Firefox accept that it should download the file.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I could send "plain text" from one mail id to another mail id in ASP.net.. but if i want to send a "link" to other mail Id what should i do..??? Plse reply..
Example:
i can send foll. details:
Name:
Address:
Telephone:
Website:(plain text)
But i want to send foll. details:
Name:
Address:
Telephone:
Website:(here it should not be a plain text. It should be a link. If i click this link it should open that website)
|
|
|
|
|
If you're sending plain text, and it's being viewed as plain text, then the best you can hope is that the mail program recognises a URL and renders a link. Otherwise, if you're sending mail to a viewer that reads HTML mail, you can embed and anchor tag.
An email is just text. If a URL renders as a clickable link has more to do with the mail program on the other end, than it can hope to have to do with your code.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have two resultset comes from two datatable
For example
Datatable1
----------
Id description
-- -----------
100 Home
101 Office
102 Practice
103 Training Centre
Datatable2
----------
Id description
-- -----------
100 Home
102 Practice
I want to compare the above datatables and bind the unmatched records in the GridView
The result should be
Id description
-- -----------
101 Office
103 Training Centre
how can i get the above result?
My code
--------
DataSet dsFetchAddress = null;
DataSet dsFetchAddressType = null;
DataTable dtFetchAddress;
dsFetchAddress = m_Profile.FetchFacultyAddress(m_factultyKey);
dsFetchAddressType = m_Profile.FetchAddress();
dtFetchAddress = dsFetchAddressType.Tables[0].Select("Id! ='dsFetchAddress.Tables[0].Select("Id")'");
I don't the exact syntax.
pls give the solution.
|
|
|
|
|
Hi programmers,
i have a problem , in my webform class i have 1 property and 2 method i want to access this property and method in to my other general class that is test.vb
but i tried with creating the object of class of webform but in .net intellisence is not recognizing the class
please help me to make it work.
thanks
2) my second question is im changing the text of texbox using the javascirpt .how to use this textbox text in general class like test.vb
thanks
|
|
|
|
|
Creating an instance of the webform class makes no sense. If the property you're after can exist outside of the form ever existing, then it should be factored out into a middle tier class. And if you're trying to access a value in a web form, you need to use the form instance that is generated when someone browses, creating a new instance creates new values, not the ones you're looking for.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your response,
My situation is like this.i have a webform which is changing textbox text based on javascriptfunction.i want to send this value to middle tier with out any postback.i m using callback but in page_load it is not taking the textbox text value to changed text
|
|
|
|
|
MD12 wrote: in my webform class i have 1 property and 2 method i want to access this property and method in to my other general class that is test.vb
but i tried with creating the object of class of webform but in .net intellisence is not recognizing the class
It's a wrong coding approach.
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
In my site I have used AjaxPro library to perform method invocation on the server side without postback.
My javascript code is something like this:
function my_func()<br />
{<br />
var response = test.my_serverside_method(1,2,3);<br />
if(response.error != null)<br />
{<br />
alert('error');<br />
}<br />
else<br />
{<br />
alert(response.value);<br />
}<br />
}
In this function I have invoked the serverside method and used its result.What I want is to show a message somewhere in the page dynamically before the function my_func is invoked. But my problem is that when I try to make a change on the page for example setting the innerText property of a span tag , the change does not appear immediately .
This is the code:
SetMessage('Please wait ...');<br />
my_func();<br />
SetMessage('Data fetched !');
The function SetMessage sets the innerText property of a span tag to the argument passed.
It takes some seconds for the my_func function(its code shown) to get the data from the server. It is supposed when the above code runs first the message "Please wait ..." apears on the page and after some seconds the my_func function gives its results and then the message "Data fetched" appears. But in my case the first message is not shown at all and just the my_func is invoked and then the second message appears. How can I solve this problem ??? I hope you understand my problem . Please help me . Thanks.
-- modified at 14:33 Saturday 8th September, 2007
|
|
|
|
|
I've created a PagingIndex user control that takes a data source and allocates PageSize keys from the data source to each of a collection of PageEntry objects. Each PageEntry has a first and last property, e.g. "A - C", and I use a Repeater control with a Button as my item teplate. So, every Page entry has a button with, again, e.g "A - D" n it, if that range is <= PageSize, otherwise I subdivide, giving "Aa - As", followed by "At - Be" etc.
I currently use a one column table to contain the buttons, but was wondering, as I follow the school that asserts we should only use tables for tabular data, and not layout. What would my alternatives be for not using a table? An ItemTemplate with a <asp:button> followed by suggests itself, but a table nicely disributed the button heights over the height of the containing div of the control. It;s not a big issue using a table, but I'm just curious as to other options.
|
|
|
|
|
Brady Kelly wrote: An ItemTemplate with a followed by
suggests itself
I can't see what you mean. Use the "Ignore HTML" option when you are posting markup code.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have Microsoft SQL Server 2005 and I want to add Database to App_Data folder but it is giving me error that I cannot add because I need SQL Server Express 2005 to be installed?
Is there any way to add Database to App_Data folder?
Thanks
|
|
|
|
|
shah123 wrote: I need SQL Server Express 2005 to be installed?
Actually yes.
VS needs SQLServer runtime to work with it.
SQLServer 2005 Express included in VS 2005 DVD. install it from there.
|
|
|
|
|
But why should i install SQL Server Express as I have already SQL Server Management Studio installed?
|
|
|
|
|
Hi,
I've a IFRAME and using it as textEditor for Emails but i'm not receiving the mail as formatted text as i've done it in my IFRAME textEditor i'm just receivng it as simple text becoz i'm first containing IFRAME text in a hidden text............... Plz suggest me some other ways to do it.............
I can use some other free textEditor but suggest me something in this favour.....
Thnx
-- modified at 5:07 Saturday 8th September, 2007
|
|
|
|