|
hi!
i am new to .net i m using asp.net 1.1 with c# can any one guide me how rewrite the url like i click on a category name and id is send it in url and its sub categories shown on the page again we click on some sub category we call the same page with the id of that sub category then again but if there are no further sub categories then products will shown now i am trying to do that the url looks some thing like this
site url/category/sub category/..../product name
while only one page is called again and again with just one parameter id
(e-g example.com/cat.aspx?id=1)
can any body guide me in this regard
thanx in advance
shezi
|
|
|
|
|
|
Hi friends,
I am using template fields in my gridview to display the contents. I am also including Edit and Delete CommandField. Its working perfectly. When I click Delete the particular row is deleted. But for me, when i click delete it should give some confirm msg like "Do u want to delete" if i click yes it should delete that row r no then it should leave that field.
Please Help Me.
Thanks in Advance.
Regards,
Prya
|
|
|
|
|
Hi
write following code in RowDataBound events of gridview.
If e.Row.RowType = DataControlRowType.DataRow Then<br />
Dim btn As Button = e.Row.FindControl("BtnRemove")<br />
btn.Attributes.Add("onclick", "return DelChk();")<br />
End If
pathan
|
|
|
|
|
Hi ALL
I want to share a web.config file for two projects.
I am using .Net 1.1 to create the web application.
I am having a solution and two different projects under the solution.
I want to keep one web.config file for these two projects.
Can I ?
Thanks in advance.
"I firmly believe that
any man's finest hour,
the greatest fulfillment of all that holds dear,
is that moment,
when he has worked his heart out in a good cause
and lies exhausted in the field of battle - victorious..."
|
|
|
|
|
Ok so I have an aspx page with a function in the backend aspx.vb page to display a div(has to be done server side) I have a usercontrol on the page which contains a grid. Now onclick of a button on the grid in the usercontrol, I want to call the function on the main page from the usercontrol. Is there an easier way than to make the function on the main page a shared function, this seems messy, could I somehow use the parent attribute??
Thanks a mil in advance
Colum
|
|
|
|
|
You should be able to access page containing user control as this.Page , cast it to type of your page and then you can call its public methods.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
That is excatly what I was looking for, Thank you very much dnh, but I think you have to use Parent.Page for the usercontrol and not this.Page, maybe that is just for my case but anyway thanks again
|
|
|
|
|
cullyk wrote: think you have to use Parent.Page for the usercontrol and not this.Page
hmm not really, Control.Page[^] property really points to aspx *page* where your user control is, on the other hand Parent points to control that directly contain your user control, e.g. if it is in Placeholder , Parent will be that placeholder. They both should have same Page ...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Well I want to access Functions on the page that the user control is contained in. So if I have a page called Maintenance.aspx which contains a usercontrol now I want to access a function on maintance.aspx.vb from the usercontrol I would have the following code in the usercontrol server side:
Dim maintenance As Maintenance
maintenance = CType(Parent.Page, Maintenance)
maintenance.viewQuestions() 'where viewQuestions() is a public function contained on the main page
This works fine for me as is, yet I stand to be corrected, I am I missing something?
Sorry if I have not explained this properly
|
|
|
|
|
cullyk wrote: maintenance = CType(Parent.Page, Maintenance)
could be as well
maintenance = CType(Page, Maintenance)
It's just that you said you have to use Parent.Page.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
You can do this by Delegates and Events
|
|
|
|
|
My application needs Exports to Excel and From Excel to Database
for that ,i have used the code
For Export:
Dim mySQLCommand As New SqlCommand
Dim myConnection As New SqlConnection
Dim datagrid1 As New DataGrid
Dim DS As New DataSet
Dim DT As New DataSet
myConnection = New SqlConnection("Password=technologies;Persist Security Info=False;User ID=sa;Initial Catalog=Lims_Demo;Data Source=VISHWA") 'ConfigurationSettings.AppSettings("MyConStr"))
myConnection.Open()
Dim da As New SqlDataAdapter("SELECT top 30 ProductCode,ProductName,GenericName,RetestPeriod FROM Results where status=0", myConnection)
da.Fill(DT)
datagrid1.DataSource = DT
datagrid1.DataBind()
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New Html32TextWriter(tw)
datagrid1.RenderControl(hw)
Response.Write(tw.ToString())
Dim path As String = "C:\...\abc.doc"
Response.AddHeader("content-disposition", "attachment; filename=Worddocument.xls")
Response.End()
'FileStream sourceFile = new FileStream(path, FileMode.Open);
'long FileSize;
'FileSize = sourceFile.Length;
'byte[] getContent = new byte[(int)FileSize];
'sourceFile.Read(getContent, 0, (int)sourceFile.Length);
'sourceFile.Close();
'Response.BinaryWrite(getContent);
'dim SaveFileDialog1 as System.
'If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
' RichTextBox1.SaveFile(SaveFileDialog1.FileName, _
' RichTextBoxStreamType.PlainText)
'End If
myConnection.Close()
the above coding is working very good and giving the required results
but when i am going to Import Excel data to Database
I have used the code, which i found in Msdn help
'---------------------Importing Data From Excel to Database
If Not FILE1.PostedFile.FileName = "" Then
FilePath = FILE1.PostedFile.FileName
End If
'Excel Work Sheet Database Connection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FilePath & "; " & _
"Extended Properties=Excel 8.0;")
'Select the data from Sheet1 of the workbook.
'MyConnection.Open()
'Dim dt As Table = MyConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null)
Dim f As Array
f = Split(FilePath, "\")
Dim k As Integer = f.Length
Dim str As String = f(k - 1)
Dim filename As String = str.Substring(0, str.LastIndexOf("."))
'str.Split(".xls")
'Dim f1 As Array
'f1 = Split(str, ".")
'Dim str1 As String = f1(f1.Length - 1)
Try
Dim str2 As String = "select * from [EXPnIMP$]"
'Select the data from Sheet1 of the workbook.
'MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
' str2, MyConnection)
''' Select the data from Sheet1 of the workbook.
'MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
' "select * from [" & filename & "$]", MyConnection)
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [" & filename & "$]", MyConnection)
DS = New System.Data.DataSet 'DataSet
MyCommand.Fill(DS) 'Filling The dataset
------------------------------------------------------
it is also working fine,but it is working only for Excel sheet , which i create
it is not working for the excel sheet which i created by using the above code
it is giving the below error,
i think the errror may be in exporting to excel,
when i put google search,it is showing that, file should be exclusive,how can we set exclusive to a file
the error , i am getting is :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
kishore
|
|
|
|
|
After you export the data to the excel file close it and then try to export the data from excel to database.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurv
but Even Iam doing same thing what u said, it is giving same error
kishore
|
|
|
|
|
Hi Friends ,
I want to put the repeater control on my webpage , and want to develop the functionality for Editing and Deleting like datagrid .Is it possible to inser Edit and Delete Functionalities using repeater like datagrid?
If it is possible , please guide me
Thanks
param
|
|
|
|
|
i have placed an image in the datagrid bound columns as
e.Item.Cells(i).Text = ""
it will display an image "red.gif" in the bound column.
this will call a javascript fn, which will send two values to it. Its working fine. At the same time, when i click the bound column, i want to change the image to green.gif using javascript.
same like toggle button.
How to perform this, please its urgent.
Regards,
abul.
|
|
|
|
|
hello Technicals
This is ajay.
when i m trying to run(pressing F5) my web application in Asp.net, i get the following error
"Error while trying to run project.The project is not configured to be debugged.Unable to start debugging on the web server."
I have done a lot of brainstorming on it but unfortunately could not fix it.
I have followed a lot of forums including 'support.microsoft.com/kb/306156'
i am the member of debugger users group.And am loging through administrator.So i also have the enough rights.......
Any help regarding this...
I am very worried.
one thing more when i m going through Debug->Start without Debugging
then it works fine.
Is there any error in my web.config file or something else....
plz plz help
thanks in advance
Ajay
|
|
|
|
|
add this in your web.config under <system.web>.
<compilation debug="true" />
|
|
|
|
|
ya <compilation default="" language="vb" debug="true"> is inside <system.web>
|
|
|
|
|
do u have vs 2005 installed on ur machine?
Best Regards
3ala2
|
|
|
|
|
no no
not it all...
i have only 2003 version installed on my machine..
any suggetion
|
|
|
|
|
Hi.
i am facing same error in vs 2005.
unable to start debugging on the web server.debugging failed because integrated windows authentication is not enable.
some application ,which i convert from 1.1 to 2.0,its work fine but in vs 2005 i cant run with debug.
pathan
|
|
|
|
|
|
The "who" who is using the image is probably you the first time you uploaded. Make sure that you are properly disposing of objects that you use when dealing with the image. One of them must still be holding on to the image file.
I've done had this problem before when using a System.Drawing.Image object in my code to deal with a file. After you are done with it you must dispose it to get it to release it's hold on the file. This is my example:
Dim x as System.Drawing.Image<br />
x= Drawing.Image.FromFile(strMyImageFilePath)<br />
x.Dispose()
Hope this helps.
|
|
|
|