|
Crystal Reports is not installed properly. There are lots of hits on Google for that error message. For example:
How do I resolve "bobj is undefined" issue? | SAP Blogs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I set the cache provider below, but the Add method never called... Only several Get calls I receive...
Any idea why?
public class MyCacheProvider : OutputCacheProvider
{
public override object Add(string key, object entry, DateTime utcExpiry)
{
return entry;
}
public override object Get(string key)
{
return null;
}
public override void Remove(string key)
{
}
public override void Set(string key, object entry, DateTime utcExpiry)
{
}
}
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
To send emails from an (old) asp.net website I use the following code :
-------
Protected Sub SendMail(sender As Object, e As System.EventArgs)
Try
Dim smtpSection As SmtpSection = CType(ConfigurationManager.GetSection("system.net/mailSettings/smtp"), SmtpSection)
Dim smtp As New SmtpClient
smtp.Host = smtpSection.Network.Host
smtp.EnableSsl = smtpSection.Network.EnableSsl
smtp.UseDefaultCredentials = smtpSection.Network.DefaultCredentials
smtp.Port = smtpSection.Network.Port
'solution 1 does not work !
'Dim networkCred As NetworkCredential = New Net.NetworkCredential(smtpSection.Network.UserName, smtpSection.Network.Password)
'smtp.Credentials = networkCred
'solution 2 does not work !
'Dim networkCred As New Net.NetworkCredential(smtpSection.Network.UserName, smtpSection.Network.Password)
'smtp.Credentials = networkCred
'solution 3 does work !!!
smtp.Credentials = New Net.NetworkCredential("yyyyyy@xxxxxx.com", "zzzzzz")
Using mm As New MailMessage(smtpSection.From, txtTo.Text.Trim())
mm.Subject = txtSubject.Text.Trim()
mm.Body = txtBody.Text.Trim()
mm.IsBodyHtml = False
TextBox2.Text = smtpSection.Network.UserName
TextBox3.Text = smtpSection.Network.Password
TextBox4.Text = smtpSection.Network.Host
TextBox5.Text = smtpSection.Network.Port
TextBox6.Text = smtpSection.Network.EnableSsl
TextBox7.Text = smtpSection.Network.DefaultCredentials
TextBox8.Text = smtpSection.From
TextBox9.Text = txtTo.Text.Trim()
smtp.Send(mm)
End Using
Catch error_t As Exception
TextBox1.Text = error_t.ToString
End Try
End Sub
-------
The web.config section contains this :
-------
<smtp deliveryMethod="Network" from="yyyyyy@xxxxxx.com" >
<network
host="smtp-auth.mailprotect.be"
port="2525"
userName="yyyyyyyy@xxxxxxxx.com "
password="zzzzzz"
defaultCredentials="false"
enableSsl="false"
/>
</smtp>
------
The namespaces loaded are :
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Net.Configuration" %>
Solution 3 works fine but I don't like to show passwords in a page.
When using solution 1 or 2 the mailserver replies it does not relay, so apparently the credentials are not retrieved work properly.
All the other parameters do show properly in the textboxes I designed to test this sub.
Does anyone have a suggestion ?
Thanks.
Philippe Caron
|
|
|
|
|
Two things. ASP.NET code always executes on the server, never the client. That code will never be shown as part of "a page".
The first two attempts you show as "does not work" are because you're making assumptions about what those smtpSection.Network.UserName and smtpSection.Network.Password properties are returning. I would be willing to bet they don't return anything, so you're creating a NetworkCredential with blank username and password.
How do you tell? One word: debugger. Set a breakpoint on the line that creates the NetworkCredential and examine the values of UserName and Password. Chances are good those values are not what you think they are.
|
|
|
|
|
You shouldn't need any of that code. The SmtpClient will initialize itself based on the settings in the web.config file automatically.
The SmtpClient constructor[^] calls the Initialize method[^], which reads the settings from the config file.
If it's not working, then you need to debug your code to see what settings are actually being read from your config file.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Store Dataset into session variable
|
|
|
|
|
Is that an instruction or a proud boast?
|
|
|
|
|
I look at it as a project manager trying to give direction to a team member however inadvertently instead of typing in Microsoft Teams ended up submitting a new post in CodeProject.
|
|
|
|
|
Is this some kind of spam? If not, I'm sorry, but it definitely looks like it LOL.
|
|
|
|
|
Any one please explain the REDUX.
|
|
|
|
|
|
I try to remove Server header IIS8.0 . I use below code in Global.Asax.
protected void Application_PreSendRequestHeaders() {
this.Response.Headers.Remove("Server");
Response.AddHeader("Server", "My httpd server");
}
and i use below code in web.config
[httpRuntime maxRequestLength="50000" requestValidationMode="2.0" enableVersionHeader="false"]
when I run the project I see below issue
"This operation requires IIS integrated pipeline mode"
Although Manage Pipeline mode is integrated mode.
|
|
|
|
|
Why are you trying to do this?
|
|
|
|
|
I try to remover server header IIS8.0
|
|
|
|
|
|
Good Day Everyone
I have a response which i convert to byte array and download the pdf at the end. This code does download a PDF in localhost but gives an error
{"Thread was being aborted."}
and the file still get downloaded correctly. The code is defined as below
<pre>string URL = "http://myserver/ReportServer/Pages/ReportViewer.aspx?%2fbills%2fISU_PDF_GEN_APT&rs:Command=Render";
string Command = "Render";
string Format = "PDF";
string Contract_account_number = AccountNumber;
URL = URL + "&rs:Command=" + Command + "&rs:Format=" + Format + "&Contract_Account_Number=" + Contract_account_number;
System.Net.HttpWebRequest Req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(URL);
Req.Credentials = System.Net.CredentialCache.DefaultCredentials;
Req.UseDefaultCredentials = true;
Req.Method = "GET";
System.Net.WebResponse objResponse = Req.GetResponse();
System.IO.Stream stream = objResponse.GetResponseStream();
var document = GenericMethods.StreamToByteArray(stream);
Response.AddHeader("Content-type", "application/octet-stream");
Response.AddHeader("Content-Disposition", "attachment; filename=" + AccountNumber + ".pdf");
Response.BinaryWrite(document);
Response.Flush();
Response.End();</pre>
when i host this in IIS i get an Error
The remote server returned an error: (403) Forbidden.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
The ThreadAbortException is expected when you call Response.End :
ThreadAbortException occurs if you use Response.End - ASP.NET | Microsoft Docs[^]
The error in IIS simply means that the user your application pool is running as doesn't have access to the resource you're trying to load. It works when you debug the code in Visual Studio because it's running under your user account at that point.
Change the SSRS permissions to give your App Pool user access to run the reports; change your App Pool to run as a user with the relevant permissions; or change your code to pass the credentials of a user with the relevant permissions instead of relying on the default credentials.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hello sir i have try alot but not found any library that is free and convert odf to image in asp .net core mvc. if you have then kindly suggest me
|
|
|
|
|
Did you try Ghostscript (and its .NET wrapper Ghostscript.NET). These have been able to generate good quality images out of the pages in the PDF document.
|
|
|
|
|
Here's another options in case Ghostscript is not suitable for you
|
|
|
|
|
Hello
Do you know ready plugins for api blog2.0? e.g. Tumblr, Blogger ipt.
Regards
|
|
|
|
|
|
Hi,
I am trying to install Winform Net5 feature on Mac and my desktop.
On Mac, visual studio dees not seems to display this template
|
|
|
|
|
Hi!
Can you recommend the FEED aggregator plugin? Something like CyberSeo for WP?
Regards
|
|
|
|