|
Hi there!
Go to the official site of ASP.NET.
There you can find some really good videos for beginners.
There are some 13 videos for beginners.......
And if you finish them. Then you can build a really heavy application.
http://www.asp.net/
You don't have to be AFRAID!
|
|
|
|
|
I am a bit late to VS 2005. Today I am looking at ways to rebuild one of our websites in .NET 2.0. Rather than convert I am recreating pages as I go. This isn't an issue because they need to be reworked anyway.
I opted against using the VS 2005 Web Applications Project tools to emulate 2003 in 2005 and don't want to consider that option. This site is going to be redone as a new site would.
That being said...
Our current site is made of of pages derived from a BasePage. They host user controls derived from BaseControl. Using these 2 base classes we have every page automatically check user authentication, redirection, and other housekeeping. This is done entirely on BasePage and is available to BaseControls.
If that is unclear, when a user accesses a page the BasePage checks several sources for user authentication (Session,Cookies,Database). If not correct, the user is redirected to a SignIn or AccessDenied page. If correct, the user's state is loaded for the page. From there all components on the page can query the state and populate their contents.
How would I make this work for a MasterPage setup?
The master page (as I see it) will host my UserControls directly (header, footer, side-menu). These user controls need access to the user state. The hosted content pages will also need to access the same state. I don't want each separate component hitting the database loading bits and pieces.
Basically:
Request page<br />
Page is assembled<br />
Check for security<br />
If needed, redirect<br />
Otherwise, load state for page<br />
Header populates with state info<br />
Side-menu populates based off state info<br />
Content page populates based off state info<br />
Send page to client
Something tells me that I am not quite "getting it". Am I supposed to load up the Session with huge state objects? I wouldn't think so. Too many simultaneous users for that. Can I just bulk up the MasterPage to do everything? I am lost.
|
|
|
|
|
First of all, why not use the "VS 2005 Web Applications Project template"? I use it all the time. I like compiling the apps before deployment.
Now about your design. I see no reason to put a user control in the Master Page. Why would you do that? A User Control is something designed to be used on multiple pages, the master page is on every page. So why would you have user controls in a master page?
Checking authentication in the master page is fine, then redirect to another page not in the Mater Page. Note you can have more then one master page. I think what you are asking is how to access controls in the master page from your pages and vice versa.
Let's say you wanted to handle an event from a control in the Master page on your base page, you would do the following.
<br />
ddl = (DropDownList)this.Master.FindControl("ddlMain");<br />
ddl.SelectedIndexChanged += new EventHandler(ddlMain_SelectedIndexChanged);<br />
<br />
<br />
protected void ddlMain_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
}<br />
<br />
<br />
Now if you want to access anything in your master page as long as it is not "private"
<br />
YourApp.Site objMasterPage = YourApp.Site;<br />
objMasterPage.CallPublicMethod();<br />
|
|
|
|
|
Thanks for the reply. It, with the information I've gathered today sets me on the right course.
You are absolutely right about the UserControl on the MasterPage. I got caught in old thinking vs. new thinking on that one. In .NET 1.1 I created an ASCX for the header, footer and menu becaues they actually were being created on every page dynamically. I just carried that idea forward. Thanks for setting me right.
I won't be doing any events across boundaries like your example but I may in the future and now I'll know. Thanks again.
And the YourApp.Site.Method was another piece that I was absolutely needing. I was going to be requiring all content pages to do something like ((MyMasterPage)this.Master).CallMethodHere.
Many, many thanks.
|
|
|
|
|
Hi all,
I am having a webpage in which I am printing a code behind textbox text value on to the paper by using vbscript function.
I have binded this function to a button. Everything is going clear upto this. But when I tried to I changed the text box text and click the print button, its printing before value only, but not the latest value.
I have tried in many ways to achieve this, but still it was taking previous value of the text box but not the latest one.
Please give me some idea to overcome this problem. Thank you.
Regards,
Aleem
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Dear All,
I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End
I generated local mode report but as there was no printing option available . I assign printing feature to button click by exporting the data to EMF format and print
Now when I run it through IDE VS2005 then it does not show any error.
But when I run in through IIS in intranet it showing me this error
The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process
Where I am going wrong please guide me.
Code used are
Button click code
protected void Btnprint_Click(object sender, EventArgs e)
{
LocalReport report = new LocalReport();
vw_tranTableAdapter da = new vw_tranTableAdapter();
report.ReportPath = @"D:\Inventracksys\inventorytracking\Vendorwisereport.rdlc";
report.DataSources.Add(new ReportDataSource("tran_vw_tran", da.GetDataByvendor(RadioButtonList1.SelectedValue, DropDownListvendor.SelectedValue)));
export(report);
m_currentpageindex = 0;
Print();
}
Creating stream as
private Stream CreateStream(string name, string filenameextension, Encoding encoding, string mimetype, bool willseek)
{
Stream stream = new FileStream(@"D:\Inventracksys\Inventorytracking " + name + "." + filenameextension, FileMode.Create );
//Stream stream = new FileStream(name + "." + filenameextension, FileMode.Create);
m_streams.Add(stream);
return stream;
}
Exporting to EMF
private void export(LocalReport report)
{
string deviceInfo = "<deviceinfo>" + " <outputformat>EMF" + " <pagewidth>9in" + " <pageheight>12in" + " <margintop>0.25in" + " <marginleft>0.25in" + " <marginright>0.25in" + " <marginbottom>0.25in" + ""; Warning[] warnings; m_streams = new List<stream>(); report.Render("Image", deviceInfo, CreateStream, out warnings);
foreach (Stream stream in m_streams) stream.Position = 0;
}
Printhandler event
private void PrintPage(object sender, PrintPageEventArgs ev)
{
Metafile pageImage = new
Metafile(m_streams[m_currentpageindex ]);
ev.Graphics.DrawImage(pageImage , ev.PageBounds);
m_currentpageindex++;
ev.HasMorePages = (m_currentpageindex < m_streams.Count); }
printing option
private void Print()
{
const string printerName =
"Microsoft Office Document Image Writer";
if (m_streams == null || m_streams.Count == 0)
return;
PrintDocument printDoc = new PrintDocument();
printDoc.DefaultPageSettings.Landscape = true;
printDoc.PrinterSettings.PrinterName = printerName;
// lblerrmsg.Text = printDoc.PrinterSettings.PrinterName;
if (!printDoc.PrinterSettings.IsValid)
{
string msg = String.Format(
"Can't find printer \"{0}\".", printerName);
//MessageBox.Show(msg, "Print Error");
lblerrmsg.Text = "Print Error";
return;
}
printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
printDoc.Print();
}
public void Dispose()
{
if (m_streams != null)
{
foreach (Stream stream in m_streams)
stream.Close();
m_streams = null;
}
}
Now when I run it through IDE VS2005 then it does not show any error.
But when I run in through IIS in intranet it showing me this error
The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process
Where I am going wrong please guide me.
Thanks
regards
imran khan
|
|
|
|
|
hi
i wanted to perform a search for records based on the date range specified by the user..
the input method is by way of calender extender(Ajax toolkit) which is in mm/dd/yyyy
before going to the web from i just queried the table using the query builder and it constructed a query
SELECT patient.*
FROM patient
WHERE (Dt BETWEEN CONVERT(DATETIME, '2006-08-09 00:00:00', 102) AND CONVERT(DATETIME, '2006-09-09 00:00:00', 102))
now how do i use the same query to the webform... also how will i display the results in a gridview control..
thx
Kunal
|
|
|
|
|
how is it possible to set the access rights and permissions for roles and members dynamically at runtime in ASP.Net??
|
|
|
|
|
I think you will require HTTP handlers to do so, as soon as the requests are process such things can be set there ...
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
Hello
Am a beginner in asp.net please help with trhe code for this problem.After the user selected the Projectmanager from the dropdownlist displayed insidethe repeator,when the user clicks Submit to Manager button the form should be submited to all the manager selected in the dropdownlist of the repeator.Repeator is used in mt application to create a table/number of rows.
Please help me it's agent
Thanking you in advance
oga m
|
|
|
|
|
Little problem involving ASP.NET, C#, ImageButtons and events
I have a list of many items. These are displayed as imagebuttons, and their NavigateUrl property is set to 'page.aspx?productID=' + item.productID . This works just fine, but the problem is that this actually results in a redirect, when a simple postback is enough.
The list of items is still displayed, and when redirect happens, it has to be retrieved again from the DB, whereas with postback it can just stay the same, and the new information is added to it.
How can I fix this? Is there a way to add some data (like productID) to a button, give all the dynamic buttons the same event, so that when it is pressed, you can get the information from the object sender parameter in the event?
Thank you
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
If you are using ImageButton, you can use PostbackUrl Property of the ImageButton. It does same as the NavigateUrl , but with a IsPostback = True . Check it out... I have used it long time before.
|
|
|
|
|
hi frenz,
i am new to asp.net feild, plz say me how to connect compare validator with the database and to use server.transfer. wath is the code to close the window(like unload me in vb6.0)?
mvj_asp
-- modified at 2:57 Wednesday 4th April, 2007
|
|
|
|
|
u r ! on IM || SMS. Try writing clearly. Try Search box at the top of the page.
only two letters away from being an asset
|
|
|
|
|
i want to open new browser window by cliking on button
pop-up should be open whether pop-up blocker if on or off in browser
|
|
|
|
|
If the pop-up blocker is on you will not be able to open a new window. You have to use javascript to open a new window and the pop up blocker can't tell the difference. All you can do is ask your users to turn off pop up blocker for your site.
Ben
|
|
|
|
|
|
Hi all,
We would like to implement/integrate digital signature solution with third party document management solution(which has Rich API). We looked at commercial digital signature solutions and it looked like they are not affordable at all for Non-Profit org in India.I'm lead developer on this module.
Reuirement-
- Web signing: Sign documents(Doc,XLS,PDF,Tiff) online from ASP.NET DMS solution), they have viewer
- Offline verifiablity : When documents are sent via email to someone outside organisation, how they can verify that document is from outside source.
My Findings-
- We can use Crypto API / CAPICOM to get certificate and sign it and put signature embedded in Doc,Xls,PDF file.
- For offline verifiablity who does not have DMS solution, some thick app could be given who looks for signature in Doc,Xls,PDF file and tells signer, CA, Sign date.
Problems-
Embedded signature : Client need to have Office installed to sign document, even though he does not need to edit document.
Detached signature : Document can not be verified outside Organisation or DMS solution.
It looks like I'm missing something, please shad some light or just share your views on it.
Thanks,
Maulik.
"We are all angles with only one wing, only way we can fly is cooperation"
|
|
|
|
|
Hi here am using two tables so i used join query for relation...Now i want to use this join query in update sql command...Is it possible to use it in Update...if yes, please send me a sql query for that
With Regards,
Samson
|
|
|
|
|
update a
set a.value = "value" from
TableA a join TableB b on
a.id = b.id
where b.id = 1
|
|
|
|
|
I would suggest write a SP and put the updates in transaction and perform the task
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
|
[ASP.NET1.1,C#]
how to provide Forms Authentication to a solution with more than one project.
How can i provide Forms Authentication common to entire solution when all projects have their own web.config files.
|
|
|
|
|
I want the store Values in XML file like as Database and Search/Modify/Delete the Data From that File.
and Display it in website as Tabular Format.
If you have the Code Please send Me soon
Thanks
Mohan Balal
|
|
|
|
|
What u have done so far?
What error you got, tell we are here to solve your Problem?
Dont post it simply please Send me Code Soon.
Regards,
Satips.
|
|
|
|