|
dear friends in my application m having a label control on the parent page and not i want to access this from the usercontrol. i want to change the text property of the label.
I have used this code but it is returning null.
Label lbl = (Label)this.Parent.Page.FindControl("lblErr");
if (lbl != null)
{
lbl.Text = "This shortname is already in use, please use a different shortname.";
lbl.Visible = true;
}
help me please..........
|
|
|
|
|
Hi,
I have a login page in my application. (I m using C#)
In that I have disabled Cut, Copy and Paste using Javascript. Its working fine.
But, still user can drag and drop any text in these textboxes.
How can I restrict the use from this?
I dont want to derive any class from Textbox control..
Please advice.
Regards,
-SIFAR.
|
|
|
|
|
Hi,
I found the solution in javascript only.
It was same as restricting user from Cut, Copy and Paste.
Solution is : ondrop="return false"
Regards,
-SIFAR.
|
|
|
|
|
Thanks.
I was also looking for this solution.
I rated you 5 for this question.
|
|
|
|
|
|
I was also looking for this function. Thanks. My 5+
Thanks & Regards,
Sandeep Augustine
|
|
|
|
|
Thank you Sandeep.
Regards,
-SIFAR.
|
|
|
|
|
Hi all,
to test my web application,am running from different systems simultaneously,on different logins to write a test.My problem is if there is one login,no problem,id second user login,session for the first user is replaced by second user,if one more user login,session is replaces by that.
recently who is login,that session going for all the others too.
How to solve this session clubbing..
Thanks in advance.
|
|
|
|
|
I suspect that you are refering to the Session object in a static class, so you have inadvertantly turned the Session object into a singleton.
Show some code of how you access/write to the session for confirmation.
|
|
|
|
|
Hi,
Thanks
Could u please tell me how to use singleton,where to implement.
Thanks in advance
|
|
|
|
|
I did not tell you to use a Singleton, I told you not to reference the session statically.
I did also ask you to post some code demonstrating how you read/write to the session to enable me to answer your query more accurately.
|
|
|
|
|
|
Hi all
I am trying to find Window key event inside Iframe
Can any one give me idea how to find window event inside iframe
window.frames.event
This will return null in java script
How to get Event....Help me please
Thanks
|
|
|
|
|
hi, i have a page on asp.net, i'm trying to run it on browser but i gives me error cannot find server, what should i do?by the way , the PC i'm working on is in local network
|
|
|
|
|
Hi lost_in_code,
Sounds like IIS in not configured to run your asp.net application.
Please can you give more details. e.g. Operating System / IIS or Apache etc...
Regards
Julian Mummery
Please Visit my FREE Bug / Fault Logging Website at FaultLogger.com
|
|
|
|
|
hi,i dont think the problem is from IIS 'cause i tried to open it on my PC and it worked(i run it from .net) and i dont have IIS, but when i try run it from a PC on local network it dosnt work and give the following error:
The requested URL could not be retrieved
While trying to retrieve the URL: http://localhost:3274/trywebsite/Default.aspx
The following error was encountered:
Unable to determine IP address from host name for unknown server name
This means that:
The cache was not able to resolve the hostname presented in the URL.
Check if the address is correct.
but i entered the right address, i dont know the problem!!!!
|
|
|
|
|
Hi,
You cannot use it like that.
Example
PC No.1 is running the .NET application through Visual Studio by accessing -> http://localhost:3274/trywebsite/Default.aspx
PC No.2 which is on same Local Area Network tries to access the same address. This will not work as localhost refers to PC No.2 itself and of course the application is running on PC No.1
The following is untested but may work:-
1. Find out the local IP Address of PC No.1 by going START >> Run and typing CMD [enter]
2. type IPCONFIG [enter] and note down your Ethernet Adapters IP Address (usually ner the top) it
will be something like 192.168.x.x (mine is 192.168.2.38 for example)
3. Go to PC No.2 and try to access it in browser by typing in (where the .x.x is your local ip address) ->
http://192.168.x.x:3274/trywebsite/Default.aspx
Failing that you will have to set it up as an applciation in IIS and then you will be able to access it without the port number e.g. http://192.168.x.x/trywebsite/Default.aspx
I hope this helps. Please let me know how you get on.
Regards
Julian Mummery
Please Visit my FREE Bug / Fault Logging Website at FaultLogger.com
|
|
|
|
|
HI!
I do not know how to populate my GridView with stored procedure I have this code but it doesn't works she returned result or error message
public void BindData()
{
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand("PS_NV2", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "TAble");
myConnection.Open();
myCommand.ExecuteNonQuery();
GridView2.DataSource = ds;
try
{
GridView2.DataBind();
}
catch
{
GridView2.PageIndex = -1;
GridView2.DataBind();
}
myConnection.Close();
correct me please.Thanks
|
|
|
|
|
execute the executenonquery before putting into adapter.
|
|
|
|
|
Thank you Satish Mahapatra.
it doesn't works
this code works fine for a datagrid but not for the GridView
I do not know if the error can come from here
for datagrid i have DataGrid1.CurrentPageIndex = 0;
I have replaced by : GridView2.PageIndex =0 ;
thanks.
|
|
|
|
|
can u send me whole code and where exactly ur getting the error with error description.
|
|
|
|
|
I have no erreur no message erreur if i click sur the button I havent result.
my code c#:
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Collections;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
}<br />
public void BindData()<br />
{<br />
SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
SqlCommand myCommand = new SqlCommand("PS_NV2", myConnection);<br />
myCommand.CommandType = CommandType.StoredProcedure;<br />
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);<br />
DataSet ds = new DataSet();<br />
myAdapter.Fill(ds, "table");<br />
myConnection.Open();<br />
myCommand.ExecuteNonQuery();<br />
GridView2.DataSource = ds;<br />
try<br />
{<br />
GridView2.DataBind();<br />
}<br />
catch<br />
{<br />
GridView2.PageIndex = 0;<br />
GridView2.DataBind();<br />
}<br />
myConnection.Close();<br />
<br />
}<br />
private string ConnectionString<br />
{<br />
get<br />
{<br />
string connectionString = (@"Data Source=.\SQLEXPRESS;UID=sa;Password=**3*;Initial Catalog=mybd");<br />
<br />
return connectionString;<br />
}<br />
}<br />
protected void GridView2_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)<br />
{<br />
Response.Write(e.NewSelectedIndex); <br />
<br />
}<br />
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
GridViewRow row = GridView2.SelectedRow;<br />
<br />
TextBox4.Text = row.Cells[2].Text;<br />
<br />
}<br />
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)<br />
{<br />
GridView2.EditIndex = e.NewEditIndex;<br />
BindData();<br />
}<br />
<br />
protected void GridView2_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)<br />
{<br />
GridView2.EditIndex = -1;<br />
BindData();<br />
}<br />
<br />
<br />
protected void Button1_Click1(object sender, EventArgs e)<br />
{<br />
BindData();<br />
GridView2.Visible = true;<br />
}<br />
}<br />
<asp:gridview id="GridView2" runat="server" allowpaging="True" autogeneratecolumns="False" xmlns:asp="#unknown"><br />
DataKeyNames="c1" OnRowCancelingEdit="GridView2_RowCancelingEdit"<br />
OnRowEditing="GridView2_RowEditing" OnSelectedIndexChanged="GridView2_SelectedIndexChanged"<br />
OnSelectedIndexChanging="GridView2_SelectedIndexChanging" Style="left: -214px;<br />
position: relative; top: 82px"><br />
<selectedrowstyle backcolor="Yellow" /><br />
<columns><br />
<asp:templatefield headertext="c1"><br />
<edititemtemplate><br />
<asp:textbox id="id0" runat="server" text="<%# Bind("c1") %>"></asp:textbox><br />
</edititemtemplate><br />
<itemtemplate><br />
<asp:label id="id01" runat="server" text="<%# Bind("c1") %>"></asp:label><br />
</itemtemplate><br />
</asp:templatefield><br />
<asp:templatefield headertext="c22"><br />
<edititemtemplate><br />
<asp:textbox id="id1" runat="server" text="<%# Bind("c2") %>"></asp:textbox><br />
</edititemtemplate><br />
<itemtemplate><br />
<asp:label id="id11" runat="server" text="<%# Bind("c2") %>"></asp:label><br />
</itemtemplate><br />
</asp:templatefield><br />
<asp:templatefield headertext="c33"><br />
<edititemtemplate><br />
<asp:textbox id="id2" runat="server" text="<%# Bind("c3") %>"></asp:textbox><br />
</edititemtemplate><br />
<itemtemplate><br />
<asp:label id="id21" runat="server" text="<%# Bind("c3") %>"></asp:label><br />
</itemtemplate><br />
</asp:templatefield><br />
<br />
<br />
<asp:commandfield showeditbutton="True" showselectbutton="True" /><br />
</columns><br />
</asp:gridview>
thanks
|
|
|
|
|
i told u to put that executenonquery statement before putting into adaptare.now u just debug the code and see in the binddata method what it returns in the dataset and tell me.
|
|
|
|
|
Thank you Satish Mahapatra it works I forgot a field in my stored procedure.
|
|
|
|
|
Dear sir/madam
I have designed a login page where a user can enter,user name and password.The program can compare the password from database and can verify.The program is ok for a single user.
But when we have multiple user then i got the problem.The problem is that how can we know the specific user have logged in by comparing the password with database.And after comparing the password,how can we generate the name of the user stored in database in a new page..
waiting for the reply..
|
|
|
|