|
you got any saple or examples which i can use?
only tried the 100% way in html so far
thx by the way
|
|
|
|
|
Hi every one,
I need help in making a page to post back when another page postsback, lets say when a button is clicked in the other page!!
Your help is highly appreciated..
Thanks
|
|
|
|
|
You mean, you have 2 web pages? 1 is parent and another is the child?
Example:
parentWeb.aspx -> main web page.
parentWeb.aspx call another webPage (ex. childWeb.aspx).
When user click button on childWeb.aspx, you can make parentWeb.aspx post back by this way:
On childWeb.aspx:
var wndParams = window.dialogArguments;
opener = wndParams[0]; --> parentWeb.aspx
function onButtonClick()
{
opener.doWebPostback();
}
On parentWeb.aspx:
function doWebPostback()
{
document.Form1.submit();
}
Hope this can help you
Lili
|
|
|
|
|
First of all thank you..
I have a page contains 2 frames, each is a .aspx, and I want to force the second one to post back when a button in the first page is clicked, its not a parent and child pages..
Thanks again anyway..
|
|
|
|
|
hi all
I've implemeneted microsofts default membership provider, everything works great. I need
to restrict users from changing their password to a password they already used in the last
x months.
Does anyone know how the default membership provider can do this? If not, any ideas on how
to implement it?
we have passwords hashed, so we cant really store em outside of aspnet ourseleves.
thanks in advance.
moazzam
|
|
|
|
|
Ass far as I know you would have to extend the MemberShipProvider to add this feature
only two letters away from being an asset
|
|
|
|
|
but where do we save the passwords? and how do you compare them? they're hashed.
|
|
|
|
|
You would of course need to save n number of previous password hashes to compare the new one against. Where to save them is up to you but a simple update trigget on the table could be used.
only two letters away from being an asset
|
|
|
|
|
Hi,
I have a validation summary control (bulleted list disp mode) that i want to update not(!) when the page is submitted but while i'm doing client side javascript validation.
Is it possible? And if it is possible, how do you add a bulleted message?
Thanks a lot in advance and happy passover!
Snir.
|
|
|
|
|
|
Thanks mate, but this doesn't answer my question.
I want to use validation summary capability of displaying and managing a bulleted list of messages. Only i want that the range validators will write their error messages during client side validation and not during submit.
|
|
|
|
|
Does anybody know if it's even possible?
|
|
|
|
|
all ur validation controls have EnableClientScript = true property.. that means as soon as the text changes, the validation will fire..
and wen u`ll click on the submit button, the validation summary will be displayed.. and no page postback will occur...
so check.. EnableClientScript property..
Kunal
|
|
|
|
|
I'm trying to save myself some time and loads of typing, and want to use a for loop to generate table rows within a DataList element.
This is what the code looks like in general:
<asp:datalist ...="">
<itemtemplate>
...
<table...>
...
<% for (int i=1; i<=10; i++) { %>
<%# DataBinder.Eval(Container.DataItem, "somefield_a_"+i.ToString())%><%# DataBinder.Eval(Container.DataItem, "somefield_b_"+i.ToString())%><%# DataBinder.Eval(Container.DataItem, "somefield_c_"+i.ToString())%><% } %>
The dots are there to make this readable, there are hundreds of fields in the data source and the template is quite large. Some of them end in _1, _2, _3 etc and rather than typing in all the rows I'd like to just specify one and let the for loop do the work for me.
I guess something like this would have been fine in ASP but it's obviously not working in .NET.
Is there any way to achieve what I'm trying to do in .NET?
|
|
|
|
|
I think you can get it to work, but you may need to use a page.Bind in your code behind. I haven't tried to do a for loop, but I have done if statements. So I would try a page.bind.
Ben
|
|
|
|
|
If I understand correctly Page.Bind is just like calling DataBind on every control.
There's no problem with the data source here, or data binding, it's all working fine.. I'd just like to have a for loop that goes through the row and replaces the last character in the field name with the one from the variable.
Rather than doing this:
<%# DataBinder.Eval(Container.DataItem, "somefield_a_1")%><%# DataBinder.Eval(Container.DataItem, "somefield_b_1")%><%# DataBinder.Eval(Container.DataItem, "somefield_c_1")%><%# DataBinder.Eval(Container.DataItem, "somefield_a_2")%><%# DataBinder.Eval(Container.DataItem, "somefield_b_2")%><%# DataBinder.Eval(Container.DataItem, "somefield_c_2")%><%# DataBinder.Eval(Container.DataItem, "somefield_a_3")%><%# DataBinder.Eval(Container.DataItem, "somefield_b_3")%><%# DataBinder.Eval(Container.DataItem, "somefield_c_3")%>etc.. you get the picture..
|
|
|
|
|
Actually, what I have found is without the Page.Bind the <% for loop stuff doesn't get evaluated. I guess I should say that if your code above is in a control then you can just bind the control as well.
I recently had a formview that was doing some conditional stuff with. If I didn't do the forview.databind you would see the <% if statements on the page.
So what I am saying is that Page.Bind will hopefully work for you in translating your for loop to the code above.
Ben
|
|
|
|
|
Use a Repeater control or a DataList control
only two letters away from being an asset
|
|
|
|
|
hi
i just wanted help to insert a single listbox item into the databse.
<br />
lb.Text = ListBox1.SelectedValue.ToString();<br />
cmd2.CommandText = "Insert into Bill(BillNo,PatID,Test) Values('" + maxlbl.Text + "','" + patid.Text + "','" +lb.Text+ "' ";
now, wat should be correct statement to set the label text of the listitem that is currently selected.
Kunal
|
|
|
|
|
First, you should be using stored procedures. If you can't then at least use a SqlCommand and SqlParameters.
Second, never allow unvalidated text to be inserted into your command or database.
only two letters away from being an asset
|
|
|
|
|
i know its bad programming practice, and very much prone to sql injection...
but just a mini project thing.. for some hit and trial..
Kunal
|
|
|
|
|
All the more reason to practice more correct techniques. When the deadline is near you will code what is quick and spend hours debugging and fixing afterward.
only two letters away from being an asset
|
|
|
|
|
hmm.. thats a point.. should go for the best possible practices..
cmd.Parameters.Add(); @list
now how do i pass the listbox item value into this..
Kunal
|
|
|
|
|
anyone can help ?
Server Error in '/aspx' Application.
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true">
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
ASP.Default_aspx.CreateDataView() +67
ASP.Default_aspx.Page_Load(Object sender, EventArgs e) +497
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
It is our attitude towards life and work that makes our life 100%
|
|
|
|
|
Are you trying to run an application developed in Framework 2.0? If you are, you'll have to configure your web server appropriately.
|
|
|
|