|
Hello,
I'm trying to make a single "page patch" to an existing ASP.NET website. All I want to do is comment-out some phone number validation code that I want the app to ignore, and recompile the dll to include this change. I've been told that one way this can be done is to "hotwire" the codebehind page by changing the this line of the .aspx page:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="checkout_main.aspx.vb" Inherits="mywebsite.checkout_main"%>
...so that "Codebehind=" reads "Src=", and so that the project name is stripped out of the inherits, so that "mywebsite.checkout_main" just reads "checkout_main". However, now I get a compilation error when I run the page with these changes:
Server Error in '/' Application.<br />
Compilation Error<br />
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.<br />
<br />
Compiler Error Message: BC30188: Declaration expected.<br />
<br />
Source Error:<br />
<br />
Line 5: Namespace mywebsite<br />
Line 6: <br />
***Line 7: Partial Class checkout_main *** [emphasis mine, this line was marked red by the error page]<br />
Line 8: Inherits System.Web.UI.Page<br />
Line 9: Protected WithEvents loginid As System.Web.UI.WebControls.TextBox
Here is the part of the codebehind page the error seems to be referencing:
Imports System.Data.SqlClient<br />
Imports System.Web.Mail<br />
<br />
Namespace mywebsite<br />
<br />
Partial Class checkout_main<br />
Inherits System.Web.UI.Page<br />
Protected WithEvents loginid As System.Web.UI.WebControls.TextBox<br />
Protected WithEvents password As System.Web.UI.WebControls.TextBox<br />
Protected WithEvents password1 As System.Web.UI.WebControls.TextBox<br />
Protected WithEvents CompareFieldValidator1 As System.Web.UI.WebControls.CompareValidator<br />
Protected WithEvents hint_q As System.Web.UI.WebControls.DropDownList<br />
Protected WithEvents Hint_answeer As System.Web.UI.WebControls.TextBox<br />
Protected WithEvents Salutation As System.Web.UI.WebControls.DropDownList<br />
Dim myconnection As SqlConnection<br />
Dim mycommand As SqlCommand<br />
Dim chk_lib As New main()<br />
Dim retval As String<br />
Dim insertstr As String<br />
Dim b_addr As String<br />
Dim b_city1 As String<br />
Dim b_state1 As String<br />
Dim b_pn As String<br />
Dim ots As String
When I change Src and Inherits back, things work ok, just not with the changes. I must be doing something very simple wrong... any advice would be greatly appreciated.
|
|
|
|
|
I'm trying to determine which approach is the best (realizing that is somewhat subjective).
I have a header/footer for some web pages that can be modified by the client, although rarely. Initial thought (and current implementation) was to read file contents, at application start, into application storage area. Every session start will check file timestamp and reload data if needed (to prevent having to unload application by stopping IIS). However, realizing that the client has trememdously bloated HTML for footer (several 1000 lines), I'm wondering if simply reading the file each time would be more efficient.
What is the general consensus and/or is there a better approach?
|
|
|
|
|
Hi...I'm trying to access the onbeforeunload property of the body tag from a content page. ...Since the body tag is maintained at the Master level, how is it that I go about accessing it? I was hoping that Master.Attributes["onbeforeunload"] would do the trick, but no luck.
-- modified at 16:36 Monday 23rd April, 2007
Welcome my son...Welcome..to the Machine
|
|
|
|
|
In the master page add runat="server" to the body tag and give it some id.
In the content page access it like:
((HtmlGenericControl)Master.FindControl("bodyid")).Attributes["onunload"] = "alert('unloading!')";
|
|
|
|
|
good idea..thanks a lot
Welcome my son...Welcome..to the Machine
|
|
|
|
|
I have a list of IDs(which I get from select ID from tbl_IDs) and have a stored proc which takes this ID and does some function.
I have loaded IDs in a list box and allowed multiple select.
As stored procs dont support arrays to be passed as parameters, I thought that If I run stored proc in a loop and iterate through every value in listbox it should work.
but now the problem is it doesnt work
e.g
for each strID in lstId.selectedvalues
call stored proc and in parameters for stored proc, pass listid.selectedvalue
next
any ideas how to do this.
regards
|
|
|
|
|
drequinox wrote: I thought that If I run stored proc in a loop and iterate through every value in listbox it should work.
Wow - nasty
drequinox wrote: As stored procs dont support arrays to be passed as parameters
You can pass a string which is comma seperated values and chop it up in the proc. Or, you can pass in XML ( this is how I would do it ) and SQL Server can turn an XPath into a table of values which you can then query against.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
drequinox wrote: but now the problem is it doesnt work
What do you mean by "It doesn't work"?
Does anything happen? Does something happen, but its the wrong thing? What happens when you step through the code with the debugger?
|
|
|
|
|
Many thanks for your reply
This is what I am doing, in debug it stays at the first number which I selected, and dimcellnumber has just first char of listitemvalue in it...
dont know what to do, I think I am little new in it...
regards
dim mobilecellnumber as string
Protected Sub cmdAssignNorth_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If lstMobGroup.SelectedValue Is Nothing Then
Exit Sub
End If
For Each mobileCellnumber In LstNorth.SelectedValue
Dim cmdAssign As New DataSet1TableAdapters.DepotsTableAdapter
retvalue = CType(cmdAssign.sp_MM_AllocateToMobGroup(lstMobGroup.SelectedValue, LstNorth.SelectedValue), Integer)
Next
If retvalue = 1 Then
strStatus = "Success"
labelstat.Visible = True
labelstat.Text = "Operation Succeeded"
labelstat.Text = LstNorth.SelectedValue
ElseIf retvalue = 2 Then
strStatus = "Fail"
labelstat.Visible = True
labelstat.Text = "Operation Failed"
End If
End Sub
|
|
|
|
|
Code behind - .aspx.vb
Partial Class Ce_PerfMeasVW
Inherits System.Web.UI.Page
Dim cetrend_view As String
Dim cetrend_pmeasure As String
Dim cetrend_ptitle As String
Dim objBaseClass As BusinessObjectBase
Dim CePM_BusinessObj As Construction_Bll
Dim p_measure As String()
Dim inf_factor As Boolean
Dim view_type As String
Dim from_dates As String()
Dim to_dates As String()
Dim Dt_CePM As DataTable
Dim dal_obj As Construction_Dal
Dim a As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If Page.IsPostBack = False Then
'cetrend_view = Session("view_type")
'cetrend_pmeasure = Session("p_measure")
'cetrend_ptitle = Session("page_title")
cetrend_view = Request.QueryString("v_type").ToString()
cetrend_pmeasure = Request.QueryString("p_meas").ToString()
cetrend_ptitle = Request.QueryString("p_title").ToString()
lbl_ce_perfmeashd.Text = cetrend_ptitle
p_measure = New String() {0, 1}
p_measure = Split(cetrend_pmeasure, ("-"), (-1))
inf_factor = chk_ce_perfmeasinf.Checked
view_type = ddl_ce_perfmeasvw.SelectedItem.Value
If rb_ce_perfmeasmon.Checked Then
objBaseClass = New BusinessObjectBase
from_dates = New String() {0, 1}
from_dates = objBaseClass.get_month_year(ddl_ce_perfmeasyrs1.SelectedItem.Value, ddl_ce_perfmeasmon1.SelectedItem.Value)
to_dates = New String() {0, 1}
to_dates = objBaseClass.get_month_year(ddl_ce_perfmeasyrs2.SelectedItem.Value, ddl_ce_perfmeasmon2.SelectedItem.Value)
ElseIf rb_ce_perfmeasqtr.Checked Then
objBaseClass = New BusinessObjectBase
from_dates = New String() {0, 1}
from_dates = objBaseClass.get_quater_year(ddl_ce_perfmeasyrs3.SelectedItem.Value, ddl_ce_perfmeasqtr1.SelectedItem.Value)
to_dates = New String() {0, 1}
to_dates = objBaseClass.get_quater_year(ddl_ce_perfmeasyrs4.SelectedItem.Value, ddl_ce_perfmeasqtr2.SelectedItem.Value)
End If
dal_obj = New Construction_Dal
dal_obj.con() = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString()
CePM_BusinessObj = New Construction_Bll
Dt_CePM = CePM_BusinessObj.CePerfMeas_Retrive(p_measure, inf_factor, view_type, from_dates, to_dates)
'Session.Contents.RemoveAll()
End If
Catch ex As Exception
End Try
End Sub
End Class
**********************************************************************
Public Class Construction_Bll
Inherits BusinessObjectBase
Dim obj As Construction_Dal
Dim cost_type1 As String
Dim cost_type2 As String
Dim infl_factor As Boolean
Dim view_typ As String
Dim main_fdate As Date
Dim main_tdate As Date
Dim Dt_CePM As DataTable
Public Function CePerfMeas_Retrive(ByVal p_measure As String(), ByVal inf_factor As Boolean, ByVal view_type As String, ByVal from_dates As String(), ByVal to_dates As String()) As DataTable
Dim Dt_BegEst As DataTable
Dim Dt_EndEst As DataTable
cost_type1 = p_measure(0)
cost_type2 = p_measure(1)
infl_factor = inf_factor
view_typ = view_type
main_fdate = Convert.ToDateTime(from_dates(0))
main_tdate = Convert.ToDateTime(to_dates(0))
main_fdate = Format(main_fdate, "MM, dd, yyyy")
main_tdate = Format(main_tdate, "MM, dd, yyyy")
obj = New Construction_Dal
Dt_BegEst = obj.CePerfMeas_data(cost_type1, cost_type2, view_typ, main_fdate, main_tdate)
Dt_EndEst = obj.CePerfMeas_data(cost_type2, cost_type1, view_typ, main_fdate, main_tdate)
Return Dt_CePM
End Function
***********************************************************************
Public Class Construction_Dal
Inherits BusinessObjectBase
Public conn As OleDb.OleDbConnection
Dim a As String
Public Property con() As String
Get
Return a
End Get
Set(ByVal value As String)
a = value
End Set
End Property
#Region "Estimate measure Trends"
Public Function CePerfMeas_data(ByVal cost_type1 As String, ByVal cost_type2 As String, ByVal view_type As String, ByVal main_fdate As Date, ByVal main_tdate As Date) As DataTable
Dim Dt_CePM As New DataTable()
Dim Sql_CePerfMeas1 As String
Dim dbcomm As OleDb.OleDbCommand
Dim str As String
str = con()
conn = New OleDb.OleDbConnection(str)
Sql_CePerfMeas1 = "select sum(CST_TYP_AMT), to_char(inside.CST_TYP_DT,'MM/01/yyyy') from IEIT002_CONTESTM,(Select to_char(CST_TYP_DT,'MM/01/yyyy') from IEI where CNSTESTM_CSTTYP_CD = " & cost_type2 & " and CST_TYP_DT between " & main_fdate & " and " & main_tdate & ") inside where CNSTESTM_CSTTYP_CD = " & cost_type1 & " and WPITEM || WPITMSEG || WPPHAZGP || WPPHAZTP || FINPRJSQ in (select WPITEM || WPITMSEG || WPPHAZGP || WPPHAZTP || FINPRJSQ where CNSTESTM_CSTTYP_CD = " & cost_type2 & " and CST_TYP_DT between " & main_fdate & " and " & main_tdate & ") "
dbcomm = New OleDb.OleDbCommand(Sql_CePerfMeas1, conn)
Dim da As New OleDb.OleDbDataAdapter(dbcomm)
da.Fill(Dt_CePM)
Return Dt_CePM
End Function
|
|
|
|
|
Stop spamming the forum.
---
single minded; short sighted; long gone;
|
|
|
|
|
Is this meant to be a question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hi Guys,
I want to generate barcode in ASP.Net 2.0, what steps i should taken in account to do so, please give some useful links and hits to get me started.
That barcode should be read by using barcode reader as well, i mean if both can be developed that will be greate.
Thanks, in Advance.
Many Thanks,
adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
ASP.NET has nothing to do with generating barcodes. It exists to generate HTML. So, you need to read the articles on CP on how to generate a barcode, and if you want to display it on a web page, you need to generate the bitmap and send it to your client as part of a web page.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hello anyone,
I made a custom control which must take part of a framework for developpers. To get more speed with developements, I wanted to limit the list of properties available for the developper.
I've found the code to do that in this article:
Hiding Inherited Properties from the PropertyGrid
I applied the code and saw that worked very fine, too fine. Alle the properties I wanted to hide were hidden, but when I wanted to show them again, they never came back.
I tried many things such as deleting code, removing VS temp files, crashing the project and rewrite it, nothing makes my lost properties visible again.
But the worth, is that if I use the control on another PC, all the properties I can't see on mine are visible. I don't understand, it drives me crazy.
Please, if you don't want to send a man in asylum, help me.
Goudax
|
|
|
|
|
Hello All,
How can I receive and send bill payment information to Quickbooks 2005 accounting software.
If anyone knows, let me know URL or sample code.
Thanks & Regards,
Kumar
|
|
|
|
|
data table 1:
est amt date
1000 01/01/2004
2000 02/01/2003
1000 03/20/2005
5000 10/30/2006
1000 12/30/2004
Data table 2:
Inf num Year
2.31 2003
1.02 2004
0.87 2005
1.06 2006
1.19 2007
inflation factor: inflate all amt to 2007 dollar value
example: logic
to inflate the est amt in 1 datatable to 2007 dollar value
est amt date
1000 01/01/2004
To get the inflated amount =
( 1000(Est amt for year 2004) * 0.87 (inf num for 2005)) + 1000(Est amt for year 2004) )
= EA2005 (est amout inflated to 2005)
(EA2005*1.06(inf num for 2006) + EA2005 = EA2006 (est amout inflated to 2006)
(EA2006*1.19(inf num for 2007) + EA2006 = EA2007(est amout inflated to 2007)
|
|
|
|
|
data table 1:
est amt date
1000 01/01/2004
2000 02/01/2003
1000 03/20/2005
5000 10/30/2006
1000 12/30/2004
Data table 2:
Inf num Year
2.31 2003
1.02 2004
0.87 2005
1.06 2006
1.19 2007
inflation factor: inflate all amt to 2007 dollar value
example: logic
to inflate the first est amt in 1 datatable to 2007 dollar value
est amt date
1000 01/01/2004
To get the inflated amount =
( 1000(Est amt for year 2004) * 0.87 (inf num for 2005)) + 1000(Est amt for year 2004) )
= EA2005 (est amout inflated to 2005)
(EA2005*1.06(inf num for 2006) + EA2005 = EA2006 (est amout inflated to 2006)
(EA2006*1.19(inf num for 2007) + EA2006 = EA2007(est amout inflated to 2007)
|
|
|
|
|
Hello Everyone
Actully I m using CreateUserWizard1 control in asp.net But how to save data in table i donot know.
When i click CreateUser button ,then CreateUserWizard1_CreatedUser this event comes .
I know insert query .but i dont know the name of User Name ,Password name .
Plz help
Thanks
Care Career
|
|
|
|
|
Hi friends
I am working in asp.net (C#)
I have one registration page.When user successfully registered user will be redirect to mySite.com/userprofile.aspx.
I want to change the url like mySite.com/username instead of above url.
Thanks in advance
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
you need to rewrite the URL. This[^] will help you in that regard.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have made a login form in which i had encrypted the username and password and stored it in the cookies . I am decrypting the cookies also.
NOW while testing i want to test if the user if disabled cookies then what will happen ? to start with i started with my comp . i deleted cookies folder in internet explorer internet settings . but by this only the cookies which are there get deleted. It does not stop the app to form cookies . So i went in security settings adjusted it to high . THen i opened privacy blocked both 1st party and 3rd party cookies . BUT then too the cookies are getting formed . ATlast i deleted all the folders cookies from my computer but one cookies folder i could not delete.
The problem is cookies are getting formed. I want to see that they are not formed and an error message is generated .
thanks in advance.
|
|
|
|
|
Use the Request.Browser.Cookies property.
|
|
|
|
|
please give me relevant codings.
thanks in advance.
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!Request.Browser.Cookies)
{
ClientScript.RegisterStartupScript(typeof(this), "NoCookies", "<script>alert('Please enable cookies!')</script>");
}
}
|
|
|
|
|