|
Yes you are right.. We dont use Framesets now...
Reason :
1. It is very hard to handle Javascript Events when there is more than one frame in the document. We have to reference controls from other pages only using window.parent . For example : If you just willing to change the text of a control with some operation of another frame, you need to hook the textbox object in Window.parent object and then get its reference. So we are unnecessarily creating complexity .
2. In Asp.NET we rely with Server side events most of the time. In case of Frames, 2 or more document is created, so if you postback a page, u cant reference the other pages. So we need to forcefully postback other forms to get reference in the server. Also forcing postback of 2 pages simultaneously will create two requests to the server. So you need create custom form element to ensure everything goes in a single postback, which means more complexity .
3. Frames looks very odd and unprofessional to me. Err.. Although, That might be only my problem...
So I would recommend to make layout using Table.
<table style="width:100%;border:0px">
<tr>
<td style="width=30%">
</td>
<td>
<td>
</tr>
</table>
You can create the same page layout easily using table. If you are worried about the splitter control.. you can find a lots of them easily by searching in google. Or you can also create one yourself.
So personally I suggest you to avoid Framesets totally.
|
|
|
|
|
Hi,
I am using datalist to display a Datatable, which contains one text from a multiline textbox,
I found that the multiline mode does not maintains anymore in the datalist, that is to say, the text is diaplayed in one or two every long lines
I want to know what parameter determine the displayed width of one line? I tried several parameters, no any effect.
how to solve this problem? thanks!
modified on Sunday, September 6, 2009 10:11 AM
|
|
|
|
|
|
thanks, actually I have read this two articles before I asked the question here.
I found that my problem is different with those mentioned in the articles.
My prblem is originated from the save of the multiline text into database.
I have checked that if I use 'return' by hand during input text, then the text is correctly saved into database (SQL), but if I do
not use 'return' by hand, then the multiline text becomes automatically one line in the database. By the way, I have used 'Text' format to save the text into SQL datatable.
i.e. now the problem is becoming: how to let SQL tabel knows the input is multiline text.
one strange thing is that: the set width (even small) of DataList control can not display the text into multilines.
|
|
|
|
|
Hello everyone,
I got struck while finding a defense against sql injection.....plz explain how to use regular expression validators on server side so that user is unable to modify source code and inject code.....i found stored procedure a bit of complex so don't wanna use parameterised querries........
|
|
|
|
|
|
greendragons wrote: i found stored procedure a bit of complex so don't wanna use parameterised querries........
Stored procedure and parameterized queries are not same. Parameterized queries are just normal queries with parameters. I don't think there is any complexity involved in using it and it is the obvious method to prevent SQL injection attacks.
|
|
|
|
|
Hey.. Why do you need Regular Expression validators to prevent from SQL injection.... ??
I think it is good to have data validation in the client side... For Example :
"\d+" will only take numeric values...
You may use like
"^(Insert|Update|Delete|Select)([A-Z][a-z]+)+" [It might be better if I take time]
to ensure that the user dont enter DML statements in input.
But why do you need to do this?? I think only a simple thing solves the entire problem. Say you have a TextBox called txtName in the page, you write :
using(SqlCommand cmd = new SqlCommand("Update name = @pName where id='23'",con))
{
SqlParameter param = new SqlParameter("@pName", SqlDbType.NVarchar);
param.value = txtName.Text;
cmd.Parameters.add(param);
cmd.ExecuteNonQuery();
}
Isnt it simple enough???
|
|
|
|
|
I have one question in using validator control in ASP.net:
let's say, I have a validator bound to a textbox, just to check whether the text is empty or not.
I only want the validator checks the textbox when I click some button (such as submit), but I found that the validator also works when I do not click this button. e.g. even I try to redirect to other page, the validator still checks and I can not redirect to other page.
I am wondering, is there any property I can use to handle this problem directly except I use enable and disable functions?
thanks!!
|
|
|
|
|
Seraph_summer wrote: I am wondering, is there any property I can use to handle this problem directly except I use enable and disable functions?
Yes, That is ValidationGroup Property
In your case, Textbox , Submit button and RequiredFiledValidator Should have same ValidationGroup.
For your Referecne :
VAlidation Group[^]
Hope this will help you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I think you can put the textbox and button in a same validationGroup .
|
|
|
|
|
thanks for both o you!
I got it!
|
|
|
|
|
Hi everybody , I have designed a web form and it has a simple Query to read data from a table .
my connection is logicaly true but I face to a error like this .
Error :
**************
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
**************
but I am sure that the server allows remote Connections .
my Connection in winform works properly .
and in design mode , before I view the webpage , Like using SqlDataSource I Can read data and make query .
please help me about this problem .
|
|
|
|
|
Does your Web Server and Database server are in same system or in different System ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
these are in different systems.
|
|
|
|
|
This is a general problem when the Datatabase service couldnt be found.
I think the connectionstring is the culprit here. Compare the connection string with one that works in Winforms. I think there must be some mistake on it.
|
|
|
|
|
I have compared them . and also I have copyed connectionString from winform to web form but it did not work.
code is:
new SqlCommand("select [Name],MdbPath from __WorkSpace__", new SqlConnection("Data Source=Ahmadi;Initial Catalog=__Sys__;Persist Security Info=True;User ID=David;Password=500"));
|
|
|
|
|
Check like this :
SqlConnection con = new SqlConnection("Data Source=Ahmadi;Initial Catalog=__Sys__;Persist Security Info=True;User ID=David;Password=500");
con.open();
Does con.Open gives the same error ?
Also you told me that your SQL DataSource does work. Just check its connectionstring as well. Follow the steps :
Go to
View->Server Explorer
Right Click on DataConnections -> add Connection
In the dialog box :
Server Name : Ahmadi<br />
Use SqlServer Autentication, User Name = David, PAssword = 500<br />
Select Database Name : __sys__
Finally click OK.
Now when the node is created, right click on the node and go properties, and check ConnectionString . Use this connectionstring. I think it should be working fine.
|
|
|
|
|
Good Day
Can we see your connection string and show us the name of your sql instance, the name of the SQWl instance we dont mean the name of the computer. When you connect to sql query analyzer there is a part that says Server, post that name and give us the connectionstring and we will point the problem.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi , ofcourse
connectionstring is :
Data Source=Ahmadi;Initial Catalog=__Sys__;Persist Security Info=True;User ID=David;Password=500")
it works in winform properly . I have Tested it .
|
|
|
|
|
is "__Sys__" the name of your database ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I add webservice to my site and write a simple one.
but I can't use this webservice in another pages.
I mean that i don't know how use this service.
for example i want to use webservice on button_click Event.
|
|
|
|
|
Why on earth do you need to use your webservice from your site ? That's just pointless. I think what you may want to use is AJAX, but that's different.
You should probably explain what it is you're trying to achieve. It sounds to me like you need to read a basic book and find out what these things are for, but I could be wrong.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ha ha ... You are right.
|
|
|
|
|
I have right click on my website in visual studio->add newitem->WebService.asmx
i write a simple translator in Service.cs
but I can't use this service in my website?
|
|
|
|